-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (49 loc) · 1.48 KB
/
images.yaml
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
name: OCI Container Images
on:
push:
tags:
- "v*"
env:
NODE_VERSION: 18.8.0
PYTHON_VERSION: 3.10.6
NODE_ENV: production
jobs:
container_images:
name: Build and publish OCI Container Images.
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup QEMU
uses: docker/setup-qemu-action@v1
- name: Calculate short SHA
run: echo "SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-8)" >>"$GITHUB_ENV"
- name: Build container image
uses: redhat-actions/buildah-build@v2
id: build_image
with:
image: ${{ env.IMAGE_NAME }}
build-args: |
NODE_VERSION=${{ env.NODE_VERSION }}
PYTHON_VERSION=${{ env.PYTHON_VERSION }}
NODE_ENV=${{ env.NODE_ENV }}
tags: >
latest
${{ env.SHORT_SHA }}
${{ github.sha }}
${{ github.ref_name }}
containerfiles: ./Containerfile
- name: Push image to registry
uses: redhat-actions/push-to-registry@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}