Skip to content

Merge pull request #133 from UserOfficeProject/dependabot-npm_and_yar… #142

Merge pull request #133 from UserOfficeProject/dependabot-npm_and_yar…

Merge pull request #133 from UserOfficeProject/dependabot-npm_and_yar… #142

Workflow file for this run

name: Build && Push
# Controls when the action will run.
on:
push:
branches:
- develop
- staging
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract branch name
id: extract_branch
uses: swapActions/get-branch-name@v1
- name: Create image tags
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/userofficeproject/connector
flavor: latest=true # adds :latest tag to outputs.tags
tags: type=sha,format=long,prefix= # adds :<sha> tag to outputs.tags
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
- name: Trigger pipeline
uses: swapActions/trigger-swap-deployment@v1
with:
repository: ${{ github.event.repository.name }}
environment: ${{ steps.extract_branch.outputs.branch }}
gh-trigger-url: ${{ secrets.GITLAB_TRIGGER_URL }}
gh-token: ${{ secrets.GITLAB_TRIGGER_TOKEN }}
image-tag: ${{ github.sha }}