-
Notifications
You must be signed in to change notification settings - Fork 283
64 lines (53 loc) · 2.09 KB
/
package-makeline-service.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
53
54
55
56
57
58
59
60
61
62
63
64
name: package-makeline-service
on:
push:
branches:
- 'main'
paths:
- 'src/makeline-service/**'
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
publish-container-image:
runs-on: ubuntu-latest
steps:
- name: Set environment variables
id: set-variables
run: |
echo "REPOSITORY=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT"
echo "IMAGE=makeline-service" >> "$GITHUB_OUTPUT"
echo "VERSION=$(echo ${GITHUB_SHA} | cut -c1-7)" >> "$GITHUB_OUTPUT"
echo "CREATED=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_OUTPUT"
- name: Env variable output
id: test-variables
run: |
echo ${{ steps.set-variables.outputs.REPOSITORY }}
echo ${{ steps.set-variables.outputs.IMAGE }}
echo ${{ steps.set-variables.outputs.VERSION }}
echo ${{ steps.set-variables.outputs.CREATED }}
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: src/makeline-service
file: src/makeline-service/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ steps.set-variables.outputs.REPOSITORY }}/${{ steps.set-variables.outputs.IMAGE }}:latest
${{ steps.set-variables.outputs.REPOSITORY }}/${{ steps.set-variables.outputs.IMAGE }}:${{ steps.set-variables.outputs.VERSION }}
labels: |
org.opencontainers.image.source=${{ github.repositoryUrl }}
org.opencontainers.image.created=${{ steps.set-variables.outputs.CREATED }}
org.opencontainers.image.revision=${{ steps.set-variables.outputs.VERSION }}