-
Notifications
You must be signed in to change notification settings - Fork 223
35 lines (24 loc) · 1.01 KB
/
docker-image.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
name: Docker Image CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker buildx create --use && docker buildx build --platform=linux/arm64,linux/amd64 . --file Dockerfile --tag firhq/fir-cli:latest
- name: get version Number
id: show-version
run: echo "::set-output name=result::$(docker run firhq/fir-cli:latest version | awk '{print $3}')"
- name: check version number
run: echo "the version is ${{ steps.show-version.outputs.result }}"
- name: Tag image
run: docker tag firhq/fir-cli:latest firhq/fir-cli:${{ steps.show-version.outputs.result }}
- name: Login Docker
run: docker login -u atpking -p ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Publish docker
run: docker push firhq/fir-cli:latest && docker push firhq/fir-cli:${{ steps.show-version.outputs.result }}