Skip to content

Commit 1d45f4d

Browse files
committed
2 parents 097b548 + 6a95921 commit 1d45f4d

File tree

2 files changed

+26
-28
lines changed

2 files changed

+26
-28
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Deploy
22

33
on:
44
workflow_run:
5-
workflows: ["Build"]
5+
workflows: ["Publish Docker image"]
66
types:
77
- completed
88

.github/workflows/docker.yml

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,31 @@
1-
name: Build
1+
name: Publish Docker image
22

33
on:
4-
push:
5-
branches: [ main ]
6-
pull_request:
7-
branches: [ main ]
4+
release:
5+
types: [published]
6+
permissions:
7+
contents: read
8+
packages: write
89

910
jobs:
10-
11-
build:
12-
13-
runs-on: self-hosted
14-
11+
push_to_registry:
12+
name: Push Docker image to Docker Hub
13+
runs-on: ubuntu-latest
1514
steps:
16-
- name: Login to GitHub Container Registry
17-
uses: docker/login-action@v1
18-
with:
19-
registry: ghcr.io
20-
username: ${{github.actor}}
21-
password: ${{secrets.GITHUB_TOKEN}}
22-
23-
- name: Checkout
24-
uses: actions/checkout@v2
25-
26-
- name: Build and push backend Docker image
27-
uses: docker/build-push-action@v2
28-
with:
29-
context: .
30-
push: true
31-
tags: ghcr.io/testausserveri/koirameili
15+
- name: Check out the repo
16+
uses: actions/checkout@v2
17+
18+
- name: Login to GitHub Container Registry
19+
uses: docker/login-action@v1
20+
with:
21+
registry: ghcr.io
22+
username: ${{ github.actor }}
23+
password: ${{ secrets.GITHUB_TOKEN }}
3224

33-
25+
- name: Build and push
26+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
27+
with:
28+
context: .
29+
push: true
30+
tags: ghcr.io/testausserveri/koirameili:latest,ghcr.io/testausserveri/koirameili:${{ github.event.release.tag_name }}
31+

0 commit comments

Comments
 (0)