Skip to content

Commit 363a4ec

Browse files
authored
Update the publish.yml template (#19)
* Update the publish.yml template metadata-action * Bump docker/build-push-action@v3 to v4
1 parent ec12d95 commit 363a4ec

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

README.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,27 @@ We'll start by creating the workflow file to publish a Docker image to GitHub Pa
8585
publish:
8686
runs-on: ubuntu-latest
8787
steps:
88-
- uses: actions/checkout@v3
88+
- name: Checkout
89+
uses: actions/checkout@v3
8990
# Add your test steps here if needed...
90-
- name: Build container
91-
uses: docker/build-push-action@v1
91+
- name: Docker meta
92+
id: meta
93+
uses: docker/metadata-action@v4
94+
with:
95+
images: ghcr.io/YOURNAME/publish-packages/game
96+
tags: type=sha
97+
- name: Login to GHCR
98+
uses: docker/login-action@v2
9299
with:
93-
username: YOURNAME
94-
password: ${{ secrets.GITHUB_TOKEN }}
95100
registry: ghcr.io
96-
repository: YOURNAME/publish-packages/game
97-
tag_with_sha: true
101+
username: ${{ github.repository_owner }}
102+
password: ${{ secrets.GITHUB_TOKEN }}
103+
- name: Build container
104+
uses: docker/build-push-action@v4
105+
with:
106+
context: .
107+
push: true
108+
tags: ${{ steps.meta.outputs.tags }}
98109
```
99110
1. Replace `YOURNAME` with your username.
100111
1. Commit your changes.

0 commit comments

Comments
 (0)