Skip to content

슬랙 메시지 형식 변경 #32

슬랙 메시지 형식 변경

슬랙 메시지 형식 변경 #32

Workflow file for this run

name: Docker-ghcr
on:
push:
tags:
- "v*.*.*"
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
jobs:
test:
runs-on: ubuntu-latest
environment: test
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19
check-latest: true
- name: Test
run: go test -v ./...
env:
TEST_DOCKER_PRIVATE_HOST: ${{ secrets.TEST_DOCKER_PRIVATE_HOST }}
TEST_DOCKER_PRIVATE_IMAGE: ${{ secrets.TEST_DOCKER_PRIVATE_IMAGE }}
TEST_DOCKER_PRIVATE_TAG: ${{ secrets.TEST_DOCKER_PRIVATE_TAG }}
TEST_DOCKER_PRIVATE_USERNAME: ${{ secrets.TEST_DOCKER_PRIVATE_USERNAME }}
TEST_DOCKER_PRIVATE_PASSWORD: ${{ secrets.TEST_DOCKER_PRIVATE_PASSWORD }}
TEST_DOCKER_PRIVATE_SKIP: ${{ vars.TEST_DOCKER_PRIVATE_SKIP }}
TEST_DOCKER_ECR_HOST: ${{ secrets.TEST_DOCKER_ECR_HOST }}
TEST_DOCKER_ECR_IMAGE: ${{ secrets.TEST_DOCKER_ECR_IMAGE }}
TEST_DOCKER_ECR_TAG: ${{ secrets.TEST_DOCKER_ECR_TAG }}
TEST_DOCKER_ECR_SKIP: ${{ vars.TEST_DOCKER_ECR_SKIP }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
docker-build-push:
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true
- name: action-slack
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
author_name: Docker Publish - ghcr.io/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
fields: repo,message,author,eventName,took,job
env:
SLACK_WEBHOOK_URL: ${{ env.SLACK_WEBHOOK_URL }} # required
if: always()