Skip to content

Commit

Permalink
Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mlencki committed Feb 9, 2021
1 parent 6f186e7 commit 1b96410
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Push to GitHub Container Registry

on:
release:
types: [released]

env:
IMAGE_NAME: reveal.js-docker

jobs:
push:
runs-on: ubuntu-latest
steps:
- name: Check-out github repository
uses: actions/checkout@v2

- name: Log into GitHub Container Registry
run: echo "${{ secrets.SECRET_TOKEN }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin

- name: Build Docker image
run: docker build . --tag $IMAGE_NAME

- name: Push Docker image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION

0 comments on commit 1b96410

Please sign in to comment.