Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v19
uses: tj-actions/changed-files@v33
with:
files: |
server/src/configs/default.json
Expand Down
67 changes: 37 additions & 30 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Docker
on: [push, release]
on: [push]

env:
REGISTRY: ghcr.io
Expand All @@ -10,18 +10,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Setup Node.js environment
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 16
cache: "yarn"
cache: 'yarn'
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v33
with:
files: |
server/src/configs/default.json
- name: Generate latest env vars
if: steps.changed-files.outputs.any_changed == 'true'
run: |
yarn gen-env-config
- name: Commit and push changes
if: steps.changed-files.outputs.any_changed == 'true'
uses: devops-infra/action-commit-push@v0.9.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -31,33 +39,32 @@ jobs:
needs: Sync
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set .gitsha
if: github.event_name == 'push'
run: "echo ${{github.sha}} > .gitsha"
- name: Set .gitref
if: github.event_name == 'push'
run: "echo ${{github.ref}} > .gitref"
- uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set .gitsha
if: github.event_name == 'push'
run: 'echo ${{github.sha}} > .gitsha'
- name: Set .gitref
if: github.event_name == 'push'
run: 'echo ${{github.ref}} > .gitref'

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
with:
fetch-depth: 2
- name: Setup Node.js environment
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
with:
fetch-depth: 2
- name: Setup Node.js environment
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
Expand Down