website/.gitea/workflows/build-image.yml

36 lines
1.1 KiB
YAML
Raw Permalink Normal View History

2023-07-31 04:41:26 +00:00
name: build image
on:
2024-06-04 07:49:35 +00:00
push:
branches:
- master
2023-07-31 04:41:26 +00:00
jobs:
2024-06-04 07:49:35 +00:00
build image:
runs-on: ubuntu-latest
steps:
- name: code checkout
uses: actions/checkout@v4.1.6
- name: docker login
uses: docker/login-action@v2
with:
registry: registry.digitalocean.com
username: ${{ secrets.DOCKER_REGISTRY_CREDS }}
password: ${{ secrets.DOCKER_REGISTRY_CREDS }}
- name: create tag
id: create-tag
run: |
tag=$(echo ${{ github.sha }} | cut -b 1-8)
echo "::set-output name=tag::$tag"
- name: build and push
uses: docker/build-push-action@v5.3.0
with:
platforms: linux/amd64
push: true
build-args: |
REGISTRY_DOCKER_HUB=${{ vars.REGISTRY_DOCKER_HUB }}
REGISTRY_GCR=${{ vars.REGISTRY_GCR }}
REGISTRY_SIMPLE_SYSTEMS=${{ vars.REGISTRY_SIMPLE_SYSTEMS }}
tags: |
registry.digitalocean.com/ssdocker/${{ github.repository }}:${{ steps.create-tag.outputs.tag }}
registry.digitalocean.com/ssdocker/${{ github.repository }}:latest