Fix backup jobs #25
Workflow file for this run
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
name: Build and release images | |
on: | |
- push | |
- pull_request | |
concurrency: build-${{ github.sha }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Create SHA tag | |
id: sha_tag | |
run: | | |
tag=$(cut -c 1-7 <<< $GITHUB_SHA) | |
echo "tag=$tag" >> $GITHUB_OUTPUT | |
- name: Build postgresql-s3-backup image | |
run: docker build ./images/postgresql-s3-backup/ -t ghcr.io/quiltmc/postgresql-s3-backup:latest -t ghcr.io/quiltmc/postgresql-s3-backup:${{ steps.sha_tag.outputs.tag }} | |
- name: Build mongodb-s3-backup image | |
run: docker build ./images/mongodb-s3-backup/ -t ghcr.io/quiltmc/mongodb-s3-backup:latest -t ghcr.io/quiltmc/mongodb-s3-backup:${{ steps.sha_tag.outputs.tag }} | |
- name: Login to Github Container Registry | |
if: github.ref == 'refs/heads/main' | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push images to the registry | |
if: github.ref == 'refs/heads/main' | |
run: | | |
docker push ghcr.io/quiltmc/postgresql-s3-backup:latest | |
docker push ghcr.io/quiltmc/postgresql-s3-backup:${{ steps.sha_tag.outputs.tag }} | |
docker push ghcr.io/quiltmc/mongodb-s3-backup:latest | |
docker push ghcr.io/quiltmc/mongodb-s3-backup:${{ steps.sha_tag.outputs.tag }} |