Skip to content

Commit

Permalink
Host released docker image on ghcr.io (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarmet committed May 8, 2023
1 parent 1c15b8f commit 6f4b71e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 36 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ jobs:
uses: scality/workflows/.github/workflows/docker-build.yaml@v1
with:
name: gh-actions-exporter
namespace: scality
50 changes: 14 additions & 36 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,33 @@ on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to be released'
description: Tag to be released
required: true
prerelease:
description: "Is the release a prerelease ?"
description: Define the release as pre-release
required: false
default: false
type: boolean

jobs:
release-manager:
docker:
uses: scality/workflows/.github/workflows/docker-build.yaml@v1
with:
name: gh-actions-exporter
namespace: scality
tag: ${{ inputs.tag }}

release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildk
uses: docker/setup-buildx-action@v1
with:
buildkitd-flags: --debug

- name: Login to Registry
uses: docker/login-action@v1
with:
registry: registry.scality.com
username: ${{ secrets.REGISTRY_LOGIN }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: "registry.scality.com/gh-actions-exporter/gh-actions-exporter:${{ github.event.inputs.tag }}"

create-git-release:
runs-on: ubuntu-latest
needs: [ release-manager ]
needs: docker
steps:
- name: Create Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
target_commitish: ${{ github.sha }}
tag_name: ${{ github.event.inputs.tag }}
name: Release ${{ github.event.inputs.tag }}
prerelease: ${{ github.event.inputs.prerelease }}
tag_name: ${{ inputs.tag }}
name: Release ${{ inputs.tag }}
prerelease: ${{ inputs.prerelease }}

0 comments on commit 6f4b71e

Please sign in to comment.