chore(deps): update actions/checkout digest to 34e1148 #1418
This file contains hidden or 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
| name: Docker | |
| on: | |
| push: | |
| branches: | |
| - "master" | |
| - "renovate/*" | |
| jobs: | |
| build: | |
| name: "Build (${{ matrix.component }})" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| component: [api, scraper] | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v2 | |
| with: | |
| platforms: arm64 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Log into registry ${{ env.REGISTRY }} | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GH_TOKEN }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: ${{ matrix.component }} | |
| push: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' }} | |
| platforms: linux/amd64 | |
| file: ${{ matrix.component }}/Dockerfile | |
| tags: | | |
| ghcr.io/devsoc-unsw/timetable-${{ matrix.component }}:${{ github.sha }} | |
| ghcr.io/devsoc-unsw/timetable-${{ matrix.component }}:latest | |
| labels: ${{ steps.meta.outputs.labels }} | |
| deploy: | |
| name: Deploy (CD) | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| concurrency: production | |
| if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| repository: devsoc-unsw/deployment | |
| ref: dev | |
| token: ${{ secrets.GH_TOKEN }} | |
| - name: Install yq | |
| uses: mikefarah/yq@v4.40.5 | |
| - name: Update deployment | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
| run: | | |
| git config user.name "CSESoc CD" | |
| git config user.email "technical@csesoc.org.au" | |
| git checkout -b update/tt-scraper/${{ github.sha }} | |
| yq -i '.items[0].spec.template.spec.containers[0].image = "ghcr.io/devsoc-unsw/timetable-api:${{ github.sha }}"' projects/timetable-scraper/deploy.yml | |
| yq -i '.spec.jobTemplate.spec.template.spec.containers[0].image = "ghcr.io/devsoc-unsw/timetable-scraper:${{ github.sha }}"' projects/timetable-scraper/cronjob.yml | |
| git add . | |
| git commit -m "feat(tt-scraper): update images" | |
| git push -u origin update/tt-scraper/${{ github.sha }} | |
| gh pr create -B dev --title "feat(tt-scraper): update image" --body "Updates the images for the timetable-scraper deployment to commit devsoc-unsw/timetable-scraper@${{ github.sha }}." > URL | |
| gh pr merge $(cat URL) --squash -d |