-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (30 loc) · 1.1 KB
/
push_images.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
name: Build and Push Container Image
on:
push:
tags: ['v*']
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get the latest tag
id: get_tag
run: echo "LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)" >> "$GITHUB_ENV"
- name: Authenticate to ghcr
run: echo ${{ secrets.GITHUB_TOKEN }} | buildah login --username ${{ github.actor }} --password-stdin ghcr.io
- name: Run build script
run: bash buildah_scripts/build.sh
- name: Push image
run: |
IMAGE_ID=ghcr.io/${{ github.repository }}
# Make sure IMAGE_ID is lowercase for buildah
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
echo $IMAGE_ID
echo "buildah push simline:latest $IMAGE_ID:latest"
buildah push --creds ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} simline:latest $IMAGE_ID:latest
echo "buildah push simline:latest $IMAGE_ID:$LATEST_TAG"
buildah push simline:latest $IMAGE_ID:$$LATEST_TAG