-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (46 loc) · 1.34 KB
/
Copy pathdeploy-justrunmy.yml
File metadata and controls
52 lines (46 loc) · 1.34 KB
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: Deploy to JustRunMy.App
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Log in to JustRunMy.App registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.JUSTRUNMY_REGISTRY }}
username: ${{ secrets.JUSTRUNMY_REGISTRY_USERNAME }}
password: ${{ secrets.JUSTRUNMY_REGISTRY_PASSWORD }}
- name: Resolve JustRunMy image tags
id: image
shell: bash
run: |
base_image="${{ secrets.JUSTRUNMY_IMAGE }}"
if [ -z "$base_image" ]; then
echo "JUSTRUNMY_IMAGE secret is missing"
exit 1
fi
v2_image="${base_image//v1_autodeploy/v2_autodeploy}"
v2_image="${v2_image/:v1_/:v2_}"
v2_image="${v2_image/%:v1/:v2}"
{
echo "tags<<EOF"
echo "$base_image"
if [ "$v2_image" != "$base_image" ]; then
echo "$v2_image"
fi
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.image.outputs.tags }}