-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (36 loc) · 947 Bytes
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
name: General CI
on:
push:
branches:
- 'master'
pull_request:
workflow_dispatch:
jobs:
build:
name: Build & Push
runs-on: ubuntu-latest
env:
REPOSITORY_URL: ghcr.io
IMAGE_NAME: oldtyt/shadowsocks_v2ray_docker
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Variables
id: vars
run: echo "::set-output name=SHORT_COMMIT_ID::$(git rev-parse --short HEAD)"
- name: Build image
id: docker-build
run: >-
docker build
-t $IMAGE_NAME
-t $REPOSITORY_URL/$IMAGE_NAME:latest .
- name: Docker Login
uses: docker/login-action@v3
with:
registry: ${{ env.REPOSITORY_URL }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Image
id: docker-push
run: docker push --all-tags $REPOSITORY_URL/$IMAGE_NAME