Skip to content

build: remove test dependency #74

build: remove test dependency

build: remove test dependency #74

Workflow file for this run

name: docker
env:
REGISTRY: ghcr.io
on:
push:
branches:
- main
- develop
tags:
- v*
jobs:
deploy-staging:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/heads/develop')
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Define staging tag
run: echo "STAGING_TAG=staging" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: 'linux/amd64,linux/arm64'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.CR_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
platforms: 'linux/amd64,linux/arm64'
tags: ${{ env.REGISTRY }}/masl/undershorts:${{ env.STAGING_TAG }}
deploy-production:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags')
steps:
- name: Extract Version
id: version_step
run: |
echo "##[set-output name=version;]VERSION=${GITHUB_REF#$"refs/tags/v"}"
echo "##[set-output name=version_tag;]$GITHUB_REPOSITORY:${GITHUB_REF#$"refs/tags/v"}"
echo "##[set-output name=latest_tag;]$GITHUB_REPOSITORY:latest"
- name: Print Version
run: |
echo ${{steps.version_step.outputs.version_tag}}
echo ${{steps.version_step.outputs.latest_tag}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: 'linux/amd64,linux/arm64'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.CR_TOKEN }}
- name: PrepareReg Names
run: |
echo VERSION_TAG=$(echo ${{ steps.version_step.outputs.version_tag }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
echo LASTEST_TAG=$(echo ${{ steps.version_step.outputs.latest_tag }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
platforms: 'linux/amd64,linux/arm64'
tags: |
${{ env.REGISTRY }}/${{ env.VERSION_TAG }}
${{ env.REGISTRY }}/${{ env.LASTEST_TAG }}
build-args: |
${{ steps.version_step.outputs.version }}