defensive coding to address #35 #19
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: Docker Image Build and Push CI | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta-server | |
uses: docker/metadata-action@v4 | |
with: | |
images: codelaborg/tatc-server | |
- name: Build and push the server Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
target: tatc_server | |
tags: ${{ steps.meta-server.outputs.tags }} | |
labels: ${{ steps.meta-server.outputs.labels }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta-worker | |
uses: docker/metadata-action@v4 | |
with: | |
images: codelaborg/tatc-worker | |
- name: Build and push the worker Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
target: tatc_worker | |
tags: ${{ steps.meta-worker.outputs.tags }} | |
labels: ${{ steps.meta-worker.outputs.labels }} |