Build and Push Services #29
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 Push Services | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
service: [cache-service, subscription-service, request-service] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Login to github container registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ github.token }} | |
- name: Get the tag | |
id: vars | |
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | |
- name: Build and tag latest docker image | |
run: | | |
cd build | |
make build_${{ matrix.service }} -e REGISTRY_USERNAME=${{ github.repository_owner }} | |
- name: Tag versioned image | |
run: docker tag ghcr.io/${{ github.repository_owner }}/${{ matrix.service }}:latest ghcr.io/${{ github.repository_owner }}/${{ matrix.service }}:${{ steps.vars.outputs.tag }} | |
- name: Push the images | |
run: | | |
docker push ghcr.io/${{ github.repository_owner }}/${{ matrix.service }}:latest | |
docker push ghcr.io/${{ github.repository_owner }}/${{ matrix.service }}:${{ steps.vars.outputs.tag}} |