Skip to content

Feature/2024 speakers (#47) #45

Feature/2024 speakers (#47)

Feature/2024 speakers (#47) #45

Workflow file for this run

name: Docker
on:
push:
branches:
- "main"
jobs:
build:
name: "Build Frontend"
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64
file: Dockerfile
tags: |
ghcr.io/devsoc-unsw/tech-spire-2024:${{ github.sha }}
ghcr.io/devsoc-unsw/tech-spire-2024:latest
labels: |
${{ steps.meta.outputs.labels }}
org.opencontainers.image.source=${{ github.repository }}
deploy:
name: Deploy (CD)
runs-on: ubuntu-latest
needs: [build]
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: csesoc/deployment
token: ${{ secrets.GH_TOKEN }}
ref: migration
- name: Install yq - portable yaml processor
uses: mikefarah/[email protected]
- name: Update deployment
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
git config user.name "CSESoc CD"
git config user.email "[email protected]"
git checkout -b update/tech-spire-2024/${{ github.sha }}
yq -i '.items[0].spec.template.spec.containers[0].image = "ghcr.io/devsoc-unsw/tech-spire-2024:${{ github.sha }}"' projects/tech-spire-2024/deploy.yml
git add .
git commit -m "feat(tech-spire-2024): update images"
git push -u origin update/tech-spire-2024/${{ github.sha }}
gh pr create -B migration --title "feat(tech-spire-2024): update image" --body "Updates the images for the tech-spire-2024 deployment to commit csesoc/tech-spire-2024@${{ github.sha }}." > URL
gh pr merge $(cat URL) --squash -d