Skip to content

Commit d60b3ee

Browse files
GitHub Action Updated
1 parent b4311e8 commit d60b3ee

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

.github/workflows/docker-image.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
name: Docker Image CI/CD
2-
32
on:
43
push:
54
branches:
65
- master
76

87
jobs:
9-
108
build:
11-
129
runs-on: ubuntu-latest
10+
env:
11+
SERVICE_NAME: ghcr.io/platformercloud/git-mirror-gsr
12+
CONTAINER_REGISTRY: ghcr.io
1313

1414
steps:
1515
- uses: actions/checkout@v2
16-
name: Checkout
17-
18-
- name: Directory Change
19-
working-directory: ./gsr-mirror
20-
run: echo $(pwd) && ls -a
21-
22-
- name: Image Build Push
23-
uses: docker/build-push-action@v2
16+
- name: Set Version
17+
id: event-version
18+
run: echo ::set-output
19+
name=SOURCE_TAG::${GITHUB_REF#refs/heads/}-${{github.sha}}
20+
- name: Login to GitHub Container Registry
21+
uses: docker/login-action@v1
2422
with:
25-
context: ./gsr-mirror
23+
registry: ${{ env.CONTAINER_REGISTRY }}
2624
username: ${{ github.actor }}
2725
password: ${{ secrets.TOKEN }}
28-
registry: ghcr.io
29-
repository: platformercloud/git-mirror-gsr
30-
tag_with_ref: true
31-
26+
- name: Build the Docker image
27+
run: docker build --tag
28+
${SERVICE_NAME}:latest --file
29+
Dockerfile ./gsr-mirror
30+
- name: GitHub Image Push
31+
run: docker push $SERVICE_NAME:latest
3232

0 commit comments

Comments
 (0)