generated from nordicgiant2/react-nice-resume
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
dimassaputra
committed
Feb 11, 2023
1 parent
242e6b7
commit 3ecd83c
Showing
1 changed file
with
17 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,27 @@ | ||
name: Deploy Hello World | ||
name: Deploy Docker | ||
|
||
# Run workflow on tags starting with v (eg. v2, v1.2.0) | ||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- "v*-hello-world" | ||
pull_request: | ||
branches: | ||
- 'master' | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
deploy-docker-hello-world: | ||
Deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ghcr.io/dsapoetra/landing-page | ||
flavor: latest=true | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
- name: Login to image repository | ||
if: github.ref_type == 'tag' | ||
uses: docker/login-action@v2 | ||
- name: Checkout Code | ||
uses: actions/checkout@v1 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v3 | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_REGISTRY_TOKEN }} | ||
- name: Build and Push Docker Image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: Dockerfile | ||
push: ${{ github.ref_type == 'tag' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
push: true # Will only build if this is not here | ||
tags: | | ||
ghcr.io/${{ github.repository }}:${{ github.ref }} | ||
ghcr.io/${{ github.repository }}:latest |