Merge pull request #54 from flywirecorp/dependabot/bundler/nokogiri-1… #47
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 Release Image CI | |
on: | |
push: | |
branches: | |
- master | |
env: | |
CONTAINER_TEST_IMAGE: victoriatreasure-test | |
jobs: | |
release: | |
runs-on: ubuntu-22.04 | |
outputs: | |
version: ${{ steps.version.outputs }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Docker linting | |
run: docker run --rm -v "$(pwd)/.hadolint.yaml:/.hadolint.yaml" -i hadolint/hadolint < Dockerfile | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- uses: oleksiyrudenko/gha-git-credentials@v2-latest | |
with: | |
token: "${{ secrets.GITHUB_TOKEN }}" | |
- name: Unit testing | |
run: | | |
docker build -t $CONTAINER_TEST_IMAGE --target=test . | |
docker run --entrypoint="" $CONTAINER_TEST_IMAGE rake test | |
- name: Retrieve version | |
id: get-version | |
run: echo "version"="$(cat .semver)" >> "$GITHUB_OUTPUT" | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
platforms: "linux/amd64,linux/arm64" | |
tags: flywire/victoriatreasure:latest , flywire/victoriatreasure:${{steps.get-version.outputs.version}} | |
- name: Push git tag | |
run: | | |
git tag -a ${{steps.get-version.outputs.version}} -m "releasing: ${{steps.get-version.outputs.version}}" | |
git push origin ${{steps.get-version.outputs.version}} |