-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (60 loc) · 1.91 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: CI / Deploy to GHCR
on:
push:
tags:
- '*'
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
env:
USERNAME: ${{ github.repository_owner }}
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
PASSWORD: ${{ secrets.GITHUB_TOKEN }}
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to the Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.USERNAME }}
password: ${{ env.PASSWORD }}
- name: Extract Metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=pr
type=edge
latest
${{ github.ref_name }}
labels: |
org.opencontainers.image.title=auto-user-activity
org.opencontainers.image.description=Fetch and Updates Your Readme Markdown with the Recent GitHub activity of a github user.
org.opencontainers.image.vendor=Vedansh
- name: Verify Tags and Labels
run: |
echo "## Github Action Summary - Docker CI " >> $GITHUB_STEP_SUMMARY
echo "${{ steps.meta.outputs.labels }} " >> $GITHUB_STEP_SUMMARY
- name: Build and Push Image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64,linux/arm/v7