mozhi/.gitea/workflows/push.yml
Arya Kiran 53421bc7c0
All checks were successful
mozhi pipeline / Push Docker image to Codeberg docker registry (push) Successful in 3m18s
mozhi pipeline / Build and publish artifacts (push) Successful in 14m55s
fix
2023-08-30 19:51:50 +05:30

83 lines
2.5 KiB
YAML

name: mozhi pipeline
on: push
jobs:
push_to_registry:
runs-on: ubuntu-latest
name: Push Docker image to Codeberg docker registry
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Install docker
uses: papodaca/install-docker-action@main
- name: Log in to registry
uses: docker/login-action@v2
with:
username: aryak
password: ${{ secrets.MOZHI_DOCKER_PASSWORD }}
registry: codeberg.org
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: codeberg.org/aryak/mozhi:latest
build_artifact:
runs-on: ubuntu-latest
name: Build and publish artifacts
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Setup Go compiler
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Build mozhi
run: |
go mod download
go install github.com/swaggo/swag/cmd/swag@latest
swag init
GOOS=linux GOARCH=amd64 go build -o mozhi-linux-amd64
GOOS=linux GOARCH=arm64 go build -o mozhi-linux-arm64
GOOS=windows GOARCH=amd64 go build -o mozhi-windows-amd64.exe
GOOS=windows GOARCH=arm64 go build -o mozhi-windows-arm64.exe
GOOS=darwin GOARCH=amd64 go build -o mozhi-darwin-amd64
GOOS=darwin GOARCH=arm64 go build -o mozhi-darwin-arm64
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: mozhi-linux-amd64
path: mozhi-linux-amd64
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: mozhi-linux-arm64
path: mozhi-linux-arm64
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: mozhi-windows-amd64.exe
path: mozhi-windows-amd64.exe
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: mozhi-windows-arm64.exe
path: mozhi-windows-arm64.exe
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: mozhi-darwin-amd64
path: mozhi-darwin-amd64
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: mozhi-darwin-arm64
path: mozhi-darwin-arm64