Skip to content

Commit

Permalink
Merge pull request #37 from avencera/add-github-container
Browse files Browse the repository at this point in the history
Push to github docker registry
  • Loading branch information
praveenperera authored Jul 7, 2021
2 parents aceea45 + 32b0f7e commit 6223065
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 15 deletions.
61 changes: 46 additions & 15 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,56 @@
name: Release CI
name: Release Dockerized CI

on:
push:
tags:
- '*'
- "v*"

jobs:

build:
runs-on: ubuntu-latest
name: Build Docker image for tagged release
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get the tagged version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Build the Docker image for the tagged release
run: docker build . --tag ${{ secrets.DOCKERHUB_USERNAME }}/rustywind:${{ steps.get_version.outputs.VERSION }}
- name: Build the Docker image for the latest tag
run: docker build . --tag ${{ secrets.DOCKERHUB_USERNAME }}/rustywind:latest
- name: Push to Docker Hub
if: github.event_name != 'pull_request'
run: docker login -u="${{ secrets.DOCKERHUB_USERNAME }}" -p="${{ secrets.DOCKERHUB_TOKEN }}" && docker push ${{ secrets.DOCKERHUB_USERNAME }}/rustywind:latest && docker push ${{ secrets.DOCKERHUB_USERNAME }}/rustywind:${{ steps.get_version.outputs.VERSION }}
- name: Checkout
uses: actions/checkout@v2

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: |
avencera/rustywind
ghcr.io/avencera/rustywind
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=semver,pattern={{major}}
type=sha
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [Unreleased]

- Create dockerized version thanks [@JeroenG](https://github.com/Jeroen-G) [#36](https://github.com/avencera/rustywind/pull/36)

## [0.12.1] - 2021-06-13

- Prevent panic if class name same as variant is used
Expand Down

0 comments on commit 6223065

Please sign in to comment.