Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Merge pull request #252 from JensDll/staging #3

Merge pull request #252 from JensDll/staging

Merge pull request #252 from JensDll/staging #3

name: Deploy docker
on:
workflow_dispatch:
push:
branches:
- main
jobs:
create_tag:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
- name: Creating new tag
id: tag
run: |
tag=$(date +"%Y.%m.%d.%H.%M")
echo "tag=$tag" >> $GITHUB_OUTPUT
build_and_push_app:
needs:
- create_tag
environment:
name: DockerHub
runs-on: ubuntu-latest
steps:
- name: Checking out the repository
uses: actions/checkout@v3.5.2
- name: Setting up Quick Emulator (QEMU)
uses: docker/setup-qemu-action@v2.1.0
with:
platforms: linux/arm64,linux/amd64
- name: Setting up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2.4.1
- name: Logging in to Docker Hub
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Building and pushing container image
uses: docker/build-push-action@v4.0.0
with:
context: services
file: services/steganography.api/Dockerfile
platforms: |
linux/amd64,linux/arm64
push: true
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/steganography:app.latest,
${{ secrets.DOCKER_HUB_USERNAME }}/steganography:app.${{ needs.create_tag.outputs.tag }}
cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/steganography:app.cache
cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/steganography:app.cache,mode=max