Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
feat: setup ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphg6 committed Feb 15, 2022
1 parent d78a0c7 commit c2b91ef
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 42 deletions.
43 changes: 1 addition & 42 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,45 +49,4 @@ jobs:
run: go build -v ./...

#- name: Test
# run: go test -v ./...
build:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'tag' }}
steps:
-
name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: |
raphaelpinto/featws-ruller
ghcr.io/raphaelpinto/featws-ruller
# 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}}
type=sha
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: .
load: true
file: ./Dockerfile
push: ${{ github.event_name == 'tag' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# run: go test -v ./...
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish image to Docker Hub
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: |
raphaelpinto/featws-ruller
ghcr.io/raphaelpinto/featws-ruller
# 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}}
type=sha
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: .
load: true
file: ./Dockerfile
push: ${{ github.event_name == 'tag' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit c2b91ef

Please sign in to comment.