Add upload to gcs bucket workflow #22
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 server image | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build_base_builder: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Paths Changes Filter | |
uses: dorny/paths-filter@v2 | |
id: changes | |
with: | |
filters: | | |
lock: | |
- 'server/Cargo.lock' | |
- name: Login to DockerHub | |
if: steps.changes.outputs.lock == 'true' | |
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin | |
- name: Build Base Builder Image | |
if: steps.changes.outputs.lock == 'true' | |
run: | | |
cd server | |
docker build -f Dockerfile.base-builder --target base-builder -t johnshaughnessy/track-base-builder . | |
docker push johnshaughnessy/track-base-builder | |
build_and_push: | |
runs-on: ubuntu-latest | |
needs: build_base_builder # Specify that this job depends on `build_base_builder` | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Login to DockerHub | |
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin | |
- name: Build and Push App Image | |
run: | | |
cd server | |
docker build -t johnshaughnessy/track-server . | |
docker push johnshaughnessy/track-server |