-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (35 loc) · 1.15 KB
/
docker-image.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
name: Docker Image CI
on:
push:
branches: [ "main" ]
schedule:
- cron: "0 10 * * 2"
env:
GITHUB_IMAGE_NAME: ghcr.io/${{ github.repository }}
DOCKER_IMAGE_NAME: superfaz/mssql-initialized
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --tag ${{ env.GITHUB_IMAGE_NAME }}:latest --tag ${{ env.DOCKER_IMAGE_NAME }}:latest
- name: Log in to the GitHub Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push Docker image to GitHub
run: docker push ${{ env.GITHUB_IMAGE_NAME }}:latest
- name: Log in to the Docker Container registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push Docker image to GitHub
run: docker push ${{ env.DOCKER_IMAGE_NAME }}:latest