Skip to content

Commit a08466e

Browse files
author
Stephen Corya
committed
update github workflow
1 parent ebcd09a commit a08466e

File tree

1 file changed

+32
-14
lines changed

1 file changed

+32
-14
lines changed

.github/workflows/main.yml

+32-14
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,65 @@
11
name: Main Branch CI
22

3-
# For all pushes to the main branch run the tests and push the image to the
4-
# GitHub registry under an edge tag so we can use it for the nightly
5-
# integration tests
63
on:
4+
workflow_dispatch:
75
push:
8-
branches: main
6+
branches:
7+
- 'main'
8+
tags:
9+
- 'v*'
10+
pull_request:
11+
branches:
12+
- 'main'
913

1014
jobs:
1115
docker:
1216
runs-on: ubuntu-latest
1317
steps:
1418

1519
- name: Check Out Repo
16-
uses: actions/checkout@v2
20+
uses: actions/checkout@v4
21+
22+
- name: Docker meta
23+
id: meta
24+
uses: docker/metadata-action@v5
25+
with:
26+
images: coryaent/krause
1727

1828
- name: Set up Docker Buildx
1929
id: buildx
20-
uses: docker/setup-buildx-action@v1
30+
uses: docker/setup-buildx-action@v3
2131

2232
- name: Cache Docker layers
23-
uses: actions/cache@v2
33+
uses: actions/cache@v3
2434
with:
2535
path: /tmp/.buildx-cache
2636
key: ${{ runner.os }}-buildx-${{ github.sha }}
2737
restore-keys: |
2838
${{ runner.os }}-buildx-
2939
3040
- name: Login to Docker Hub
31-
uses: docker/login-action@v1
41+
uses: docker/login-action@v3
3242
with:
3343
username: ${{ secrets.DOCKER_HUB_USERNAME }}
3444
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
3545

46+
- name: Login to GitHub Container Registry
47+
uses: docker/login-action@v3
48+
with:
49+
registry: ghcr.io
50+
username: ${{ github.actor }}
51+
password: ${{ secrets.GHCR_TOKEN }}
52+
3653
- name: Build and push
3754
id: docker_build
38-
uses: docker/build-push-action@v2
55+
uses: docker/build-push-action@v5
3956
with:
4057
context: ./
4158
file: ./Dockerfile
4259
builder: ${{ steps.buildx.outputs.name }}
43-
push: true
44-
tags: stevecorya/keyes:latest
60+
push: ${{ github.event_name != 'pull_request' }}
61+
tags: ${{ steps.meta.outputs.tags }}
62+
labels: ${{ steps.meta.outputs.labels }}
4563
cache-from: type=local,src=/tmp/.buildx-cache
4664
cache-to: type=local,dest=/tmp/.buildx-cache
4765

@@ -52,6 +70,6 @@ jobs:
5270
uses: yanzay/[email protected]
5371
if: always()
5472
with:
55-
chat: ${{ secrets.TELEGRAM_USER_ID }} # user id or channel name secret
56-
token: ${{ secrets.TELEGRAM_BOT_TOKEN }} # token secret
57-
status: ${{ job.status }} # do not modify this line
73+
chat: ${{ secrets.TELEGRAM_USER_ID }}
74+
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
75+
status: ${{ job.status }}

0 commit comments

Comments
 (0)