Docker Image CI #82
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |