Skip to content

Commit

Permalink
Add CD
Browse files Browse the repository at this point in the history
  • Loading branch information
francojreyes committed Mar 27, 2024
1 parent 15f7580 commit 850ab3e
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,32 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
deploy:
name: Deploy (CD)
runs-on: ubuntu-latest
needs: [ build ]
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' }}
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
repository: csesoc/deployment
ref: migration
token: ${{ secrets.GH_TOKEN }}
- name: Install yq
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/nss-scraper/${{ github.sha }}
yq -i '.spec.jobTemplate.spec.template.spec.containers[0].image = "ghcr.io/devsoc-unsw/nss-scraper:${{ github.sha }}"' projects/timetable-scraper/cronjob.yml
git add .
git commit -m "feat(nss-scraper): update image"
git push -u origin update/nss-scraper/${{ github.sha }}
gh pr create -B migration --title "feat(nss-scraper): update image" --body "Updates the image for the nss-scraper deployment to commit devsoc-unsw/nss-scraper@${{ github.sha }}." > URL
gh pr merge $(cat URL) --squash -d

0 comments on commit 850ab3e

Please sign in to comment.