-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (42 loc) · 1.31 KB
/
image.yaml
File metadata and controls
42 lines (42 loc) · 1.31 KB
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
name: image
on:
push:
branches:
- master
- v[0-9]+.[0-9]+.x
tags:
- v*
workflow_dispatch:
jobs:
image:
runs-on: ubuntu-latest
steps:
- name: Setup Qemu
uses: docker/setup-qemu-action@v3
- name: Setup Buildx
uses: docker/setup-buildx-action@v3
- name: Login Docker
uses: docker/login-action@v3
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Load Image
uses: docker/build-push-action@v6
with:
load: true
tags: ${{ github.repository }}:test
- name: Test Image
run: |
docker run --rm ${{ github.repository }}:test basjoofan eval 'println("🍀 Hello Basjoofan!");'
- name: Echo Tag
run: |
tag=${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || github.sha }}
${{ startsWith(github.ref, 'refs/tags/') }} && echo tag=${tag#v} >> $GITHUB_ENV || echo tag=${tag} >> $GITHUB_ENV
- name: Build Image
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: ${{ startsWith(github.ref, 'refs/tags/') }}
tags: |
${{ github.repository }}:latest
${{ github.repository }}:${{ env.tag }}