-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (31 loc) · 1.13 KB
/
build-and-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
name: Build and Deploy Docker
on:
push:
branches: [ main ]
jobs:
Deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@master
# - name: Build and Push Docker Image
# uses: docker/[email protected]
# with:
# push: true
# tags: |
# ghcr.io/${{ github.repository }}:${{ github.sha }}
# ghcr.io/${{ github.repository }}:${{ github.sha }}
- name: Build Container
run: docker build . -t ghcr.io/${{ github.repository }}:${{ github.sha }} -t ghcr.io/${{ github.repository }}:latest
- name: Scan container for issues
uses: Azure/container-scan@f9af925b897d8af5f7e0026b8bca9346261abc93 # v0.1
with:
image-name: ghcr.io/${{ github.repository }}:${{ github.sha }}
- name: Login to GitHub Container Registry
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.ACTIONS_PAT }}
- name: Push Container
run: docker push ghcr.io/${{ github.repository }}:latest