Skip to content

Commit

Permalink
update: ci
Browse files Browse the repository at this point in the history
update: ci

update: name of ci workflow

update: ci workflow

fix: action version

fix: platform

fix: QEMU for arm64

update: Dockerfile

fix: Dockerfile
  • Loading branch information
GZTimeWalker committed Aug 26, 2022
1 parent fa3c4f7 commit 159015d
Show file tree
Hide file tree
Showing 4 changed files with 168 additions and 53 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/ci.amd64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Image for amd64

on:
push:
branches: [ "develop", "ci-test*" ]
tags: [ "v*" ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Get Time
id: time
uses: nanzm/[email protected]
with:
timeZone: 8

- name: Docker Setup Buildx
uses: docker/[email protected]

- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: gztime
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker Metadata action
uses: docker/[email protected]
id: meta
with:
# List of Docker images to use as base name for tags
images: |
ghcr.io/${{ github.repository_owner }}/gzctf/gzctf
gztime/gzctf
# List of tags as key-value pair attributes
tags: |
latest
type=ref,event=branch
type=semver,pattern={{raw}}
type=sha,enable=true,priority=100,prefix=,suffix=,format=short
- name: Build and push
uses: docker/build-push-action@v3
with:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha
build-args: |
TIMESTAMP=${{ steps.time.outputs.time }}
GIT_SHA=${{ github.sha }}
GIT_NAME=${{ github.ref_name }}
push: true

- name: Prune old packages
uses: vlaurin/[email protected]
with:
token: ${{ secrets.PACKAGE_TOKEN }}
container: "gzctf/gzctf"
dry-run: false
tag-regex: ^[0-9a-f]{6,40}
keep-tags: |
latest
main
develop
keep-tags-regexes:
^v(.)*
keep-last: 5
untagged: true
84 changes: 84 additions & 0 deletions .github/workflows/ci.arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Image for arm64

on:
push:
branches: [ "develop", "ci-test*" ]
tags: [ "v*" ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Get Time
id: time
uses: nanzm/[email protected]
with:
timeZone: 8

- name: Docker Setup QEMU
uses: docker/[email protected]

- name: Docker Setup Buildx
uses: docker/[email protected]

- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: gztime
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker Metadata action
uses: docker/[email protected]
id: meta
with:
# List of Docker images to use as base name for tags
images: |
ghcr.io/${{ github.repository_owner }}/gzctf/gzctf
gztime/gzctf
# List of tags as key-value pair attributes
tags: |
latest
type=ref,event=branch
type=semver,pattern={{raw}}
type=sha,enable=true,priority=100,prefix=,suffix=,format=short
- name: Build and push
uses: docker/build-push-action@v3
with:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/arm64
cache-from: type=gha
cache-to: type=gha
build-args: |
TIMESTAMP=${{ steps.time.outputs.time }}
GIT_SHA=${{ github.sha }}
GIT_NAME=${{ github.ref_name }}
push: true

- name: Prune old packages
uses: vlaurin/[email protected]
with:
token: ${{ secrets.PACKAGE_TOKEN }}
container: "gzctf/gzctf"
dry-run: false
tag-regex: ^[0-9a-f]{6,40}
keep-tags: |
latest
main
develop
keep-tags-regexes:
^v(.)*
keep-last: 5
untagged: true
53 changes: 0 additions & 53 deletions .github/workflows/ci.yml

This file was deleted.

3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ RUN apt update && \
apt install -y build-essential nodejs libgdiplus libc6-dev

COPY ["GZCTF", "/src/GZCTF/"]
WORKDIR "/src/GZCTF/ClientApp"
RUN npm install --verbose

WORKDIR "/src/GZCTF"
RUN dotnet restore "CTFServer.csproj"
RUN dotnet build "CTFServer.csproj" -c Release -o /app/build --no-restore
Expand Down

0 comments on commit 159015d

Please sign in to comment.