-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (44 loc) · 1.22 KB
/
oci-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
---
name: Build
on:
push:
paths:
- .github/workflows/oci-image.yml
- Dockerfile
- cgit-pkg/**
- rootfs/**
branches:
- main
env:
IMAGE_NAME: ghcr.io/kriansa/gitty
ALPINE_VERSION: latest
S6_VERSION: v2.2.0.3
jobs:
build-and-push-image:
name: Build and push the Docker image application
runs-on: ubuntu-latest
steps:
- name: Set image tags
id: image_tags
run: |
TAGS="${IMAGE_NAME}:latest,${IMAGE_NAME}:sha-${GITHUB_SHA::8}"
echo ::set-output name=tags::${TAGS}
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push container image
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ steps.image_tags.outputs.tags }}
build-args: |
ALPINE_VERSION=${{ env.ALPINE_VERSION }}
S6_VERSION=${{ env.S6_VERSION }}