Skip to content

Commit

Permalink
Add CI job to publish k6packager Docker image to GHCR
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Mirić committed Apr 9, 2021
1 parent 90da634 commit 316efaf
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ jobs:
echo "${{ secrets.PGP_SIGN_KEY }}" > packaging/sign-key.gpg
- name: Publish packages
run: |
echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin
cd packaging
# TODO: Build and publish k6io/packager image to GH Container Registry
docker-compose pull packager
docker-compose run --rm packager
33 changes: 33 additions & 0 deletions .github/workflows/packager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: k6packager
on:
# Enable manually triggering this workflow via the API or web UI
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # weekly (Sundays at 00:00)

defaults:
run:
shell: bash

jobs:
publish-packager:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ci/s3-package-repos
- name: Build
run: |
cd packaging
docker-compose build packager
- name: Publish
env:
VERSION: 0.0.1
DOCKER_IMAGE_ID: k6io/k6packager
run: |
echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin
docker tag "$DOCKER_IMAGE_ID" "ghcr.io/${DOCKER_IMAGE_ID}:${VERSION}"
docker push "ghcr.io/${DOCKER_IMAGE_ID}:${VERSION}"
docker tag "$DOCKER_IMAGE_ID" "ghcr.io/${DOCKER_IMAGE_ID}:latest"
docker push "ghcr.io/${DOCKER_IMAGE_ID}:latest"
2 changes: 1 addition & 1 deletion packaging/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3.4'
services:
packager:
build: .
image: k6io/packager:latest
image: ghcr.io/k6io/k6packager:latest
environment:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
Expand Down

0 comments on commit 316efaf

Please sign in to comment.