-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (49 loc) · 1.56 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Docker Image CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '30 1 1,15 * *'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- name: Get current time
uses: josStorer/get-current-time@v2
id: current-time
with:
format: YYYY.MM.DD-HH.mm
- name: Docker Setup QEMU
uses: docker/setup-qemu-action@v1.2.0
- name: Docker Setup Buildx
uses: docker/setup-buildx-action@v1.6.0
- name: Log into registry Github Registry
if: github.event_name != 'pull_request'
uses: docker/#-action@v1.12.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log into registry Dockerhub
if: github.event_name != 'pull_request'
uses: docker/#-action@v1.12.0
with:
username: lareeth
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push Docker images
uses: docker/build-push-action@v2.8.0
with:
platforms: linux/amd64, linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: |
ghcr.io/lareeth/alpine-ci-tools:latest
ghcr.io/lareeth/alpine-ci-tools:${{ steps.current-time.outputs.formattedTime }}
lareeth/alpine-ci-tools:latest
lareeth/alpine-ci-tools:${{ steps.current-time.outputs.formattedTime }}
build-args: VCS_REF=`git rev-parse --short HEAD`