Skip to content

Add upload to gcs bucket workflow #22

Add upload to gcs bucket workflow

Add upload to gcs bucket workflow #22

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