Skip to content

Commit 0705433

Browse files
author
Eric Lopes
committed
Merge pull request 'Update {{cookiecutter.project_slug}}/.github/workflows/release-docker-image.yaml' (#10) from improve-actions into main
Reviewed-on: https://gitea.eol.myds.me/cluster-projects/python-project-template/pulls/10
2 parents dbb3bbc + 688baac commit 0705433

File tree

1 file changed

+45
-37
lines changed

1 file changed

+45
-37
lines changed
Lines changed: 45 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,45 @@
1-
{% raw %}
2-
name: Release Docker Image CI/CD
3-
4-
on:
5-
release:
6-
types:
7-
- published
8-
9-
jobs:
10-
set-up-docker:
11-
runs-on: ubuntu-latest
12-
steps:
13-
-
14-
name: Checkout
15-
uses: actions/checkout@v4
16-
-
17-
name: Install docker
18-
run: apt update && apt install -y docker-compose
19-
-
20-
name: Login to Docker Hub
21-
uses: docker/login-action@v3
22-
with:
23-
registry: ${{ vars.DOCKER_REGISTRY_URL }}
24-
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
25-
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
26-
-
27-
name: Set up Docker Buildx
28-
uses: docker/setup-buildx-action@v3
29-
-
30-
name: Build and push
31-
uses: docker/build-push-action@v5
32-
with:
33-
context: .
34-
file: ./Dockerfile
35-
push: true
36-
tags: ${{ vars.DOCKER_REGISTRY_URL }}/${{ github.event.repository.name }}:${{ github.ref_name }}
37-
{% endraw %}
1+
{% raw %}
2+
name: Release Docker Image CI/CD
3+
4+
on:
5+
release:
6+
types:
7+
- published
8+
- edited
9+
10+
jobs:
11+
set-up-docker:
12+
runs-on: ubuntu-latest
13+
steps:
14+
-
15+
name: Checkout
16+
uses: actions/checkout@v4
17+
-
18+
name: Install docker
19+
run: apt update && apt install -y docker-compose
20+
-
21+
name: Login to Docker registry
22+
uses: docker/login-action@v3
23+
with:
24+
registry: ${{ vars.DOCKER_REGISTRY_URL }}
25+
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
26+
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
27+
-
28+
name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v3
30+
-
31+
name: Build and push release tag
32+
uses: docker/build-push-action@v5
33+
with:
34+
context: .
35+
push: true
36+
tags: ${{ vars.DOCKER_REGISTRY_URL }}/${{ github.event.repository.name }}:${{ github.ref_name }}
37+
-
38+
name: Build and push latest
39+
uses: docker/build-push-action@v5
40+
with:
41+
context: .
42+
push: true
43+
tags: ${{ vars.DOCKER_REGISTRY_URL }}/${{ github.event.repository.name }}:latest
44+
45+
{% endraw %}

0 commit comments

Comments
 (0)