mirror of
https://github.com/yanhao98/composite-actions.git
synced 2025-07-13 23:00:48 +08:00
55 lines
1.6 KiB
YAML
55 lines
1.6 KiB
YAML
name: 持续集成
|
|
|
|
on:
|
|
push:
|
|
|
|
env:
|
|
TZ: Asia/Shanghai
|
|
|
|
jobs:
|
|
setup-node-environment-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: yanhao98/composite-actions/setup-node-environment@main
|
|
- name: Check Node and PNPM versions
|
|
run: |
|
|
set -x
|
|
which pnpm
|
|
|
|
docker-build-push-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ vars.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- uses: yanhao98/composite-actions/docker-build-push@main
|
|
id: docker-build-push
|
|
with:
|
|
build_file: ./docker-build-push/Dockerfile
|
|
build_platforms: linux/amd64
|
|
build_push: false
|
|
build_load: true
|
|
metadata_images: |
|
|
docker.io/${{ vars.DOCKERHUB_USERNAME }}/docker-example
|
|
ghcr.io/${{ github.repository }}
|
|
# metadata_tags: |
|
|
# type=schedule,pattern=nightly,enable=true,priority=1000
|
|
# type=ref,event=branch,enable=true,priority=600
|
|
# type=ref,event=tag,enable=true,priority=600
|
|
# type=ref,event=pr,prefix=pr-,enable=true,priority=600
|
|
- name: Check Docker image
|
|
run: |
|
|
set -x;
|
|
docker images;
|
|
docker run --rm ${{ steps.docker-build-push.outputs.imageid }} whoami;
|