Dockerfile/.github/workflows/lede.yml
2023-03-17 22:47:40 +08:00

43 lines
995 B
YAML

name: LEDE Docker Image
on:
watch:
types: started
push:
branches: [ 'main' ]
tags: [ 'v*.*.*' ]
env:
DOCKERFILE: Dockerfile.lede
REGION: cn-beijing
REGISTRY: registry.cn-beijing.aliyuncs.com
NAMESPACE: licsber
REPOSITORY: github
TAG: lede-${{ github.sha }}
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout V3
uses: actions/checkout@v3
- name: Login to ACR V1
uses: aliyun/acr-login@v1
with:
login-server: https://${{ env.REGISTRY }}
username: "${{ secrets.ACR_USERNAME }}"
password: "${{ secrets.ACR_PASSWD }}"
region-id: ${{ env.REGION }}
- name: Build Image
id: build
run: |
IMAGE=${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.REPOSITORY }}:${{ env.TAG }}
echo "$IMAGE" >> $GITHUB_OUTPUT
docker build -t "$IMAGE" --file ${{ env.DOCKERFILE }} .
- name: Push Image
run: |
docker push ${{ steps.build.outputs.IMAGE }}