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

Create gha workflow #9

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 0 additions & 50 deletions .circleci/config.yml

This file was deleted.

File renamed without changes.
78 changes: 78 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: build_and_test

on:
pull_request:
push:
branches:
- main

env:
DEPLOY_REGISTRY_URL: ${{ secrets.DEPLOY_REGISTRY_URL }}
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}

jobs:
build:
name: build
runs-on:
- self-hosted
- production
container: docker-hub.tw.ee/golang
defaults:
run:
working-directory: ~/actions-exporter

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Attach workspace
uses: actions/download-artifact@v2
with:
name: shared_workspace
path: ~/actions-exporter

- name: Format
run: make fmt

- name: Tests
run: make test

- name: Build
run: make build

- name: Persist to workspace
uses: actions/upload-artifact@v2
with:
path: ./*
name: shared_workspace

publish:
name: publish
runs-on:
- self-hosted
- production
container: docker.tw.ee/k8s-deployer:3.8
defaults:
run:
working-directory: ~/actions-exporter
if: github.ref == 'refs/heads/m' && github.ref == 'refs/heads/a' && github.ref == 'refs/heads/i' && github.ref == 'refs/heads/n'
needs:
- build

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Attach workspace
uses: actions/download-artifact@v2
with:
name: shared_workspace
path: ~/actions-exporter

- name: Build and Push Image
run: .github/scripts/build_and_publish.sh