Merge pull request #5 from timcallaghan/feature/v1-release #11
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: "Build release" | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
build: | |
name: "Build docker image" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '7.0.x' | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: "Cache docker layers" | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: "Docker meta" | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ github.repository }} | |
tags: latest | |
- name: Build DOTelL Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
push: false | |
outputs: type=docker,dest=/tmp/docker.tar | |
context: . | |
file: src/DOTelL.Api/Dockerfile | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha, scope=${{ github.workflow }} | |
cache-to: type=gha, scope=${{ github.workflow }} | |
- name: "Upload Docker artifacts" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: docker | |
path: /tmp/docker.tar | |
release: | |
name: DOTelL semantic release | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
permissions: | |
contents: write | |
issues: write | |
pull-requests: write | |
packages: write | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: "Download docker artifacts" | |
uses: actions/download-artifact@v3 | |
with: | |
name: docker | |
path: /tmp | |
- name: "Load docker tag" | |
run: | | |
docker load --input /tmp/docker.tar | |
docker image ls -a | |
- name: "Create release" | |
id: semantic-release | |
uses: docker://ghcr.io/open-sauced/release:2.4.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SKIP_NPM_PUBLISH: true | |
- name: "Show release output" | |
run: | | |
echo ${{ env.RELEASE_TAG }} | |
echo ${{ env.RELEASE_VERSION }} | |