Skip to content

Commit ca6c758

Browse files
committed
docker publish action
1 parent 873ac2b commit ca6c758

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/docker.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish app docker image
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [published]
7+
push:
8+
branches:
9+
- main
10+
11+
env:
12+
HUSKY: 0
13+
REGISTRY: ghcr.io
14+
IMAGE_NAME: wormholelabs-xyz/example-executor-ci-test
15+
16+
jobs:
17+
build-and-push-image:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
packages: write
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v3
26+
27+
- name: Log in to the Container registry
28+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
29+
with:
30+
registry: ${{ env.REGISTRY }}
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Extract metadata (tags, labels) for Docker
35+
id: meta
36+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
37+
with:
38+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
39+
40+
- name: Build and push Docker image
41+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
42+
with:
43+
context: .
44+
file: ./Dockerfile
45+
push: true
46+
tags: ${{ steps.meta.outputs.tags }}
47+
target: release

0 commit comments

Comments
 (0)