Skip to content

Commit 304d46b

Browse files
committed
build: push to github container registry
1 parent ca10bd2 commit 304d46b

File tree

4 files changed

+40
-7
lines changed

4 files changed

+40
-7
lines changed

.github/workflows/deploy.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Deploy to GitHub Container Registry
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
workflow_dispatch: {}
8+
9+
jobs:
10+
deploy:
11+
name: Deploy to GitHub Container Registry
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v2
16+
17+
- name: Build and push Docker image
18+
uses: docker/build-push-action@v1
19+
with:
20+
username: ${{ github.actor }}
21+
password: ${{ secrets.CR_PAT }}
22+
registry: ghcr.io
23+
repository: ${{ github.repository }}
24+
tag_with_ref: true
25+
add_git_labels: true
26+
always_pull: true
27+
push: ${{ startsWith(github.ref, 'refs/tags/') }}

Dockerfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
FROM alpine
22

33
LABEL \
4-
"name"="GitHub Repo Sync" \
5-
"homepage"="https://github.com/marketplace/actions/github-sync" \
6-
"repository"="https://github.com/repo-sync/github-sync" \
7-
"maintainer"="Wei He <[email protected]>"
4+
org.opencontainers.image.title="GitHub Repo Sync" \
5+
org.opencontainers.image.description="⤵️ A GitHub Action for syncing current repository with remote" \
6+
org.opencontainers.image.url="https://github.com/repo-sync/github-sync" \
7+
org.opencontainers.image.documentation="https://github.com/marketplace/actions/github-sync" \
8+
org.opencontainers.image.source="https://github.com/repo-sync/github-sync" \
9+
org.opencontainers.image.licenses="MIT" \
10+
org.opencontainers.image.authors="Wei He <[email protected]>" \
11+
maintainer="Wei He <[email protected]>"
812

913
RUN apk add --no-cache git openssh-client && \
1014
echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ jobs:
2626
repo-sync:
2727
runs-on: ubuntu-latest
2828
steps:
29-
- uses: actions/checkout@master
29+
- uses: actions/checkout@v2
30+
with:
31+
persist-credentials: false
3032
- name: repo-sync
31-
uses: repo-sync/github-sync@v2
33+
uses: docker://ghcr.io/repo-sync/github-sync@v2
3234
with:
3335
source_repo: ""
3436
source_branch: ""

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ author: Wei He <[email protected]>
33
description: ⤵️ Sync current repository with remote
44
branding:
55
icon: 'git-branch'
6-
color: 'black'
6+
color: 'gray-dark'
77
inputs:
88
source_repo:
99
description: GitHub public repo slug or full https clone url (with access_token if needed)

0 commit comments

Comments
 (0)