Skip to content

Commit c1ca9b9

Browse files
committed
new ghcr workflow
1 parent 72983c5 commit c1ca9b9

File tree

1 file changed

+33
-39
lines changed

1 file changed

+33
-39
lines changed

.github/workflows/main.yml

+33-39
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,39 @@
1-
name: Docker Hub CD (Node.js)
1+
name: Docker CD (Node.js)
22

33
on:
4-
push:
5-
branches: [main]
6-
pull_request:
7-
branches: [main]
4+
push:
5+
paths-ignore:
6+
- "README.md"
87

98
env:
10-
IMAGE_NAME: doganm95/ppsspp-remote-disc-server
9+
IMAGE_NAME: doganm95/ppsspp-remote-disc-server
1110

1211
jobs:
13-
build:
14-
runs-on: ubuntu-latest
15-
strategy:
16-
matrix:
17-
node-version: [14.x, 15.x]
18-
steps:
19-
- uses: actions/checkout@master
20-
- name: Use Node.js ${{ matrix.node-version }}
21-
uses: actions/setup-node@master
22-
with:
23-
node-version: ${{ matrix.node-version }}
24-
- run: docker build -t $IMAGE_NAME ./nodejs
25-
push-to-docker-hub:
26-
runs-on: ubuntu-latest
27-
steps:
28-
- name: Checkout repository
29-
uses: actions/checkout@master
30-
- name: Set up QEMU
31-
uses: docker/setup-qemu-action@master
32-
- name: Set up Docker Buildx
33-
uses: docker/setup-buildx-action@master
34-
- name: Login to DockerHub
35-
uses: docker/login-action@master
36-
with:
37-
username: ${{ secrets.DOCKERHUB_USERNAME }}
38-
password: ${{ secrets.DOCKERHUB_ACCESSTOKEN }}
39-
- name: Build and push
40-
uses: docker/build-push-action@master
41-
with:
42-
context: ./nodejs
43-
file: ./nodejs/Dockerfile
44-
push: true
45-
tags: ${{ env.IMAGE_NAME }}:latest
12+
build-and-push-to-ghcr:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
packages: write
16+
contents: read
17+
steps:
18+
- name: Check out the repo
19+
uses: actions/checkout@v4
20+
21+
- name: Log in to the container registry
22+
uses: docker/login-action@v3
23+
with:
24+
registry: ghcr.io
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Build and push docker images
29+
uses: docker/build-push-action@v5
30+
with:
31+
context: .
32+
push: true
33+
tags: |
34+
ghcr.io/doganm95/ppsspp-remote-disc-server:v${{ github.run_number }}
35+
ghcr.io/doganm95/ppsspp-remote-disc-server:${{ github.sha }}
36+
ghcr.io/doganm95/ppsspp-remote-disc-server:latest
37+
labels: |
38+
org.opencontainers.image.source=${{ github.repository_url }}
39+
org.opencontainers.image.revision=${{ github.sha }}

0 commit comments

Comments
 (0)