-
Notifications
You must be signed in to change notification settings - Fork 20
55 lines (38 loc) · 1.7 KB
/
docker-image.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Docker Image CI
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set env RELEASE_VERSION
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Build the Docker image
run: docker build . --file Dockerfile --tag asanrom/showdown-chatbot:latest
- name: Docker Login
uses: docker/[email protected]
with:
username: asanrom
password: ${{ secrets.DOCKER_TOKEN }}
- name: Add version tag to Docker image
run: docker tag asanrom/showdown-chatbot:latest asanrom/showdown-chatbot:${{ env.RELEASE_VERSION }}
- name: Push the Docker image (Current Version)
run: docker push asanrom/showdown-chatbot:${{ env.RELEASE_VERSION }}
- name: Push the Docker image (Latest)
run: docker push asanrom/showdown-chatbot:latest
- name: Docker Login (GitHub Packages)
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Tag version (GitHub Packages)
run: docker tag asanrom/showdown-chatbot:latest ghcr.io/agustinsrg/showdown-chatbot:${{ env.RELEASE_VERSION }}
- name: Tag latest (GitHub Packages)
run: docker tag asanrom/showdown-chatbot:latest ghcr.io/agustinsrg/showdown-chatbot:latest
- name: Push the Docker image (GitHub Packages) (Current Version)
run: docker push ghcr.io/agustinsrg/showdown-chatbot:${{ env.RELEASE_VERSION }}
- name: Push the Docker image (GitHub Packages) (Latest)
run: docker push ghcr.io/agustinsrg/showdown-chatbot:latest