Build cht-sync containers #408
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 cht-sync containers | |
on: | |
workflow_run: | |
workflows: ["release"] | |
types: | |
- completed | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Get the latest release tag | |
id: get_latest_release | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const latestRelease = await github.repos.getLatestRelease({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
}); | |
return latestRelease.data.tag_name; | |
- name: Build and push couch2pg | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./couch2pg | |
file: ./couch2pg/Dockerfile | |
push: true | |
tags: medicmobile/cht-sync-couch2pg:${{ steps.get_latest_release.outputs.result }} | |
- name: Build and push dataemon | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./dbt | |
file: ./dbt/Dockerfile | |
push: true | |
tags: medicmobile/dataemon:${{ steps.get_latest_release.outputs.result }} |