3.0.3 #112
Workflow file for this run
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: release | |
on: | |
release: | |
types: [published] | |
env: | |
DEV_NAMESPACE: "scality/zenko-ui/dev" | |
PROD_NAMESPACE: "scality/zenko-ui" | |
REGISTRY: "ghcr.io" | |
CONFIG_IMAGE: "zenko-ui-config" | |
jobs: | |
retag-docker-image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2.3.5 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install Oras | |
run: | | |
curl -LO https://github.com/oras-project/oras/releases/download/v${ORAS_VERSION}/oras_${ORAS_VERSION}_linux_amd64.tar.gz | |
mkdir -p oras-install/ | |
sudo tar -zxf oras_${ORAS_VERSION}_*.tar.gz -C /usr/local/bin oras | |
rm -rf oras_${ORAS_VERSION}_*.tar.gz oras-install/ | |
env: | |
ORAS_VERSION: "0.12.0" | |
- name: Oras login | |
run: oras login --username "${LOGIN}" --password "${PASSWORD}" ${REGISTRY} | |
env: | |
LOGIN: "${{ github.actor }}" | |
PASSWORD: "${{ github.token }}" | |
- name: push nginx and runtime-app-configuration | |
run: | | |
oras push ${REGISTRY}/${PROD_NAMESPACE}/${CONFIG_IMAGE}:$GITHUB_REF_NAME \ | |
runtime-app-configuration.gotempl:application/zenko-ui-runtime-config-template+json \ | |
nginx.conf.gotempl:text/nginx-conf-template | |
- name: Retag the docker image | |
run: | | |
docker pull ${REGISTRY}/${DEV_NAMESPACE}:$GITHUB_SHA | |
docker tag ${REGISTRY}/${DEV_NAMESPACE}:$GITHUB_SHA ${REGISTRY}/${PROD_NAMESPACE}:$GITHUB_REF_NAME | |
docker push ${REGISTRY}/${PROD_NAMESPACE}:$GITHUB_REF_NAME |