-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (28 loc) · 826 Bytes
/
ci.yaml
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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
run: |
docker build -t ghcr.io/${{ github.repository }}/demo-app:${{ github.sha }} .
- name: Push Docker image
run: |
docker push ghcr.io/${{ github.repository }}/demo-app:${{ github.sha }}
- name: Output image tag
run: echo "Image: ghcr.io/${{ github.repository }}/demo-app:${{ github.sha }}"