-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove bin dir and change to reusable action (#24)
* Remove bin dir and change to reusable action * Update push to true
- Loading branch information
Showing
2 changed files
with
9 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,57 +6,12 @@ on: | |
- "main" | ||
|
||
jobs: | ||
generate-matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
run_docker_jobs: ${{ steps.set-run-docker-jobs.outputs.run_docker_jobs }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }} | ||
- name: Set Matrix | ||
id: set-matrix | ||
run: | | ||
echo "matrix=$(python3 bin/generate_matrix.py submittyrpi ${{ github.event.before }} ${{ github.event.after }})" >> $GITHUB_OUTPUT | ||
- name: List Matrix | ||
run: | | ||
echo ${{ steps.set-matrix.outputs.matrix }} | ||
- name: Set Run Condition | ||
id: set-run-docker-jobs | ||
run: | | ||
num_to_build=$(echo '${{ steps.set-matrix.outputs.matrix }}' | jq '.include | length') | ||
if [[ "$num_to_build" -eq 0 ]]; then | ||
echo "run_docker_jobs=false" >> $GITHUB_OUTPUT | ||
else | ||
echo "run_docker_jobs=true" >> $GITHUB_OUTPUT | ||
fi | ||
docker: | ||
needs: | ||
- generate-matrix | ||
if: needs.generate-matrix.outputs.run_docker_jobs == 'true' | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} | ||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v3 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Docker Hub login | ||
uses: docker/login-action@releases/v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME_SUBMITTYRPI }} | ||
password: ${{ secrets.DOCKER_PASSWORD_SUBMITTYRPI }} | ||
- name: Build and push docker | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ${{ matrix.context }} | ||
push: true | ||
tags: ${{ matrix.tags }} | ||
platforms: linux/amd64,linux/arm64 | ||
|
||
call-docker-build-push: | ||
uses: submitty/action-docker-build/.github/workflows/[email protected] | ||
with: | ||
push: true | ||
docker_username: ${{ vars.docker_username }} | ||
base_commit: ${{ github.event.before }} | ||
head_commit: ${{ github.event.after }} | ||
secrets: | ||
docker_password: ${{ secrets.docker_password }} |
This file was deleted.
Oops, something went wrong.