Skip to content

ContainsBannedWords func added #14

ContainsBannedWords func added

ContainsBannedWords func added #14

Workflow file for this run

name: golang
on:
push:
branches:
- "*"
tags:
- "*"
env:
DOCKER_IMAGE: "${{ vars.DOCKER_REPO }}/${{ vars.ORGANIZATION_NAME }}-${{ github.event.repository.name }}" # wmw9/blossom-twitch
VERSION_TAG: "${{ github.ref_name }}-${{ github.run_number }}"
BRANCH_TAG: "${{ vars.DOCKER_REPO }}/${{ vars.ORGANIZATION_NAME }}-${{ github.event.repository.name }}:${{ github.ref_name }}-${{ github.run_number }}"
LATEST_TAG: "${{ vars.DOCKER_REPO }}/${{ vars.ORGANIZATION_NAME }}-${{ github.event.repository.name }}:latest"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: "go.mod"
- name: Run Unit Tests
run: go test ./...
deploy:
runs-on: ubuntu-latest
needs: test
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.DOCKER_IMAGE }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
build-args: |
${{env.VERSION_TAG}}
cache-from: type=registry,ref=${{env.LATEST_TAG}}
cache-to: type=registry,ref=${{env.LATEST_TAG}},mode=max