Skip to content

Commit 85fe29e

Browse files
authored
Merge branch 'ttgzs:master' into master
2 parents 147fb9d + 984eeda commit 85fe29e

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

.github/workflows/docker-image.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
env:
9+
# Use docker.io for Docker Hub if empty
10+
REGISTRY: ${{ secrets.TJJS_HARBOR_HOST }}
11+
IMAGE_NAME: ${{ github.repository }}
12+
13+
jobs:
14+
15+
build:
16+
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: login docker hub
20+
- uses: docker/login@v3.2.2
21+
with:
22+
registry: ${{secrets.TJJS_HARBOR_HOST}}
23+
Username: ${{secrets.TJJS_HARBOR_USERNAME}}
24+
password: ${{secrets.TJJS_HARBOR_PWD}}
25+
logout: false
26+

.github/workflows/manual.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This is a basic workflow that is manually triggered
2+
3+
name: Manual workflow
4+
5+
# Controls when the action will run. Workflow runs when manually triggered using the UI
6+
# or API.
7+
on:
8+
workflow_dispatch:
9+
# Inputs the workflow accepts.
10+
inputs:
11+
name:
12+
# Friendly description to be shown in the UI instead of 'name'
13+
description: 'Person to greet'
14+
# Default value if no value is explicitly provided
15+
default: 'World'
16+
# Input has to be provided for the workflow to run
17+
required: true
18+
# The data type of the input
19+
type: string
20+
21+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
22+
jobs:
23+
# This workflow contains a single job called "greet"
24+
greet:
25+
# The type of runner that the job will run on
26+
runs-on: ubuntu-latest
27+
28+
# Steps represent a sequence of tasks that will be executed as part of the job
29+
steps:
30+
31+
# Runs a single command using the runners shell
32+
- name: Get docker greeting
33+
run: docker pull ${{inputs.name}}
34+
- name: login tjjs
35+
uses: docker/login-action@v3.2.0
36+
with:
37+
registry: ${{ secrets.TJJS_HARBOR_HOST }}
38+
Username: ${{ secrets.TJJS_HARBOR_USERNAME }}
39+
password: ${{ secrets.TJJS_HARBOR_PWD }}
40+
logout: false
41+
- name: tag docker image
42+
run: docker tag ${{inputs.name}} ${{ secrets.TJJS_HARBOR_HOST }}/library/${{inputs.name}}
43+
- name: Push docker image
44+
run: docker push ${{ secrets.TJJS_HARBOR_HOST }}/library/${{inputs.name}}

0 commit comments

Comments
 (0)