🐳 Deploy image to the internal docker registry

* Deploy the image to the internal docker registry
* Removed unnecessary stage in backend build
This commit is contained in:
Anton Shepilov
2023-04-05 15:55:29 +02:00
committed by GitHub
parent 56e1e4be3a
commit 380f01222a
21 changed files with 58 additions and 22860 deletions
+45
View File
@@ -0,0 +1,45 @@
name: update-saas-backend
# Deploy backend only if push on "main"
on:
push:
branches: [main]
paths:
- "twake/docker/**"
- "twake/backend/**"
- ".github/workflows/**"
jobs:
publish-node:
runs-on: ubuntu-20.04
steps:
- name: "Setup version"
run: 'echo "DOCKERTAGVERSION=2023.Q1.1223" >> $GITHUB_ENV'
- name: Set env to develop
if: endsWith(github.ref, '/develop')
run: 'echo "DOCKERTAG=develop" >> $GITHUB_ENV; echo "DOCKERTAGVERSION=2023.Q1.1223" >> $GITHUB_ENV'
- name: Set env to develop
if: endsWith(github.ref, '/qa')
run: 'echo "DOCKERTAG=qa" >> $GITHUB_ENV; echo "DOCKERTAGVERSION=2023.Q1.1223" >> $GITHUB_ENV'
- name: Set env to develop
if: endsWith(github.ref, '/canary')
run: 'echo "DOCKERTAG=canary" >> $GITHUB_ENV; echo "DOCKERTAGVERSION=${{ env.DOCKERTAGVERSION }}-canary" >> $GITHUB_ENV'
- name: Set env to production
if: endsWith(github.ref, '/main')
run: 'echo "DOCKERTAG=latest" >> $GITHUB_ENV'
- name: "Push to the registry following labels:"
run: |
echo "${{ env.DOCKERTAG }},${{ env.DOCKERTAGVERSION }}"
- uses: actions/checkout@v2
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: tdrive/tdrive-node
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
workdir: twake
registry: docker-registry.linagora.com
context: .
target: production
buildoptions: "-t docker-registry.linagora.com/tdrive/tdrive-node -f docker/tdrive-node/Dockerfile"
tags: "${{ env.DOCKERTAG }},${{ env.DOCKERTAGVERSION }}"