mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-01-20 02:54:46 +00:00
WIP
This commit is contained in:
parent
360c3264bd
commit
8f44a8d223
21
.github/workflows/comment-commands.yml
vendored
Normal file
21
.github/workflows/comment-commands.yml
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
name: Slash Command Dispatch
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
jobs:
|
||||
slashCommandDispatch:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Slash Command Dispatch
|
||||
id: scd
|
||||
uses: peter-evans/slash-command-dispatch@v4
|
||||
with:
|
||||
token: ${{ secrets.SLASH_COMMANDS_PAT }}
|
||||
issue-type: pull-request
|
||||
dispatch-type: repository
|
||||
permission: write
|
||||
commands: |
|
||||
test-server
|
||||
static-args: |
|
||||
repository=${{ github.repository }}
|
||||
comment-id=${{ github.event.comment.id }}
|
||||
39
.github/workflows/publish-testserver.yml
vendored
Normal file
39
.github/workflows/publish-testserver.yml
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
name: Publish PR Docker Image
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened]
|
||||
issue_comment:
|
||||
types: [created]
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
- name: Set variables
|
||||
id: prep
|
||||
run: |
|
||||
DOCKER_IMAGE=server
|
||||
REPOSITORY="$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')" # Repository name must be lowercase in image tags
|
||||
|
||||
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
|
||||
GITHUB_SHA=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.head.sha) # GITHUB_SHA is the merge SHA, not the head commit SHA in a PR, replace it.
|
||||
fi
|
||||
|
||||
TAGS="ghcr.io/${REPOSITORY}/${DOCKER_IMAGE}:${GITHUB_SHA}"
|
||||
if [ "${{ github.ref }}" = "refs/heads/master" ]; then
|
||||
TAGS="$TAGS,ghcr.io/${REPOSITORY}/${DOCKER_IMAGE}:latest,ghcr.io/${REPOSITORY}/${DOCKER_IMAGE}:master"
|
||||
fi
|
||||
|
||||
echo ::set-output name=tags::${TAGS}
|
||||
- name: Log in to GitHub Docker Registry
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Build container image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
push: true
|
||||
tags: ${{ steps.prep.outputs.tags }}
|
||||
37
.github/workflows/test-server-command.yml
vendored
Normal file
37
.github/workflows/test-server-command.yml
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
name: Publish PR Docker Image
|
||||
on:
|
||||
repository_dispatch:
|
||||
types: [test-server-command]
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Dump the client payload context
|
||||
env:
|
||||
PAYLOAD_CONTEXT: ${{ toJson(github.event.client_payload) }}
|
||||
run: echo "$PAYLOAD_CONTEXT"
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ github.event.client_payload.pull_request.head.sha }}
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
- name: Set variables
|
||||
id: prep
|
||||
run: |
|
||||
DOCKER_IMAGE=test-server
|
||||
REPOSITORY="$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')" # Repository name must be lowercase in image tags
|
||||
TAGS="ghcr.io/${REPOSITORY}/${DOCKER_IMAGE}:${{ github.event.client_payload.pull_request.head.sha }}"
|
||||
echo ::set-output name=tags::${TAGS}
|
||||
- name: Log in to GitHub Docker Registry
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Build container image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.prep.outputs.tags }} #
|
||||
2
.github/workflows/test.yaml
vendored
2
.github/workflows/test.yaml
vendored
|
|
@ -1,9 +1,11 @@
|
|||
name: Test
|
||||
on:
|
||||
push:
|
||||
paths-ignore: .github\workflows
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
paths-ignore: .github\workflows
|
||||
types: [ opened, reopened, synchronize ]
|
||||
jobs:
|
||||
test:
|
||||
|
|
|
|||
Loading…
Reference in a new issue