Skip to content

Commit

Permalink
feat: adds multi platform support
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchezpaco committed Jul 19, 2023
1 parent d822811 commit f67496b
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 44 deletions.
83 changes: 44 additions & 39 deletions .github/workflows/release_artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,54 @@ name: Docker Release Image CI
on:
push:
branches:
- master
- master
env:
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
CONTAINER_TEST_IMAGE: victoriatreasure-test
VERSION_FILE: version.txt
CONTAINER_RELEASE_IMAGE: flywire/victoriatreasure

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

- 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
run: docker run --entrypoint="" $CONTAINER_TEST_IMAGE rake version > $VERSION_FILE

- name: Build release image
run: |
VERSION=$(cat $VERSION_FILE)
docker build -t $CONTAINER_RELEASE_IMAGE:$VERSION --target=release .
docker tag $CONTAINER_RELEASE_IMAGE:$VERSION $CONTAINER_RELEASE_IMAGE:latest
- name: Push git tag
run: |
VERSION=$(cat $VERSION_FILE)
git tag -a $VERSION -m "releasing: $VERSION"
git push origin $VERSION
- name: Push release image
run: |
VERSION=$(cat $VERSION_FILE)
docker login -u ${DOCKER_HUB_USERNAME} -p "${DOCKER_HUB_PASSWORD}"
docker push $CONTAINER_RELEASE_IMAGE:$VERSION
docker push $CONTAINER_RELEASE_IMAGE:latest
- 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}}
6 changes: 1 addition & 5 deletions .semver
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
---
:major: 0
:minor: 5
:patch: 3
:special: ''
0.6.0
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [0.6.0] - 2023-07-19
- Adds multi platform support to Victoria Treasure, now supports ARM architecture

## [0.5.3] - 2023-07-13
- Update dockerignore

Expand Down

0 comments on commit f67496b

Please sign in to comment.