-
Notifications
You must be signed in to change notification settings - Fork 5
42 lines (33 loc) · 1.27 KB
/
dockerimage.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
name: Docker Image CI
on:
workflow_dispatch:
schedule:
- cron: '5 5 5 * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build and Publish the Docker image
run: |
date_version=$(date +%Y.%m)
echo $date_version > ./version.txt
docker build . --file Dockerfile --tag minibox
docker compose build
docker compose up
echo "${{ secrets.DOCKER_PASS }}" | docker login --username ${{ secrets.DOCKER_USER }} --password-stdin
docker tag minibox foundeo/minibox:latest
docker push foundeo/minibox:latest
docker tag minibox foundeo/minibox:$date_version
docker push foundeo/minibox:$date_version
docker logout
- name: Log into github registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
- name: Push image to github registry
run: |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/minibox
docker tag minibox $IMAGE_ID:latest
docker push $IMAGE_ID:latest
date_version=$(date +%Y.%m)
docker tag minibox $IMAGE_ID:$date_version
docker push $IMAGE_ID:$date_version