-
Notifications
You must be signed in to change notification settings - Fork 4
56 lines (46 loc) · 1.64 KB
/
release_artifact.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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}}