mirror of
https://github.com/danbulant/ctf-tcp-server
synced 2026-05-19 04:08:42 +00:00
Push to github container registry
This commit is contained in:
parent
267b3cd850
commit
905e44ce8f
2 changed files with 12 additions and 5 deletions
14
.github/workflows/docker-image.yml
vendored
14
.github/workflows/docker-image.yml
vendored
|
|
@ -3,16 +3,20 @@ name: Docker Image CI
|
|||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Login to GitHub Container Registry
|
||||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||
- name: Build the Docker image
|
||||
run: docker build . --file Dockerfile --tag tcp-spawner:$(date +%s)
|
||||
run: docker build . --file Dockerfile --tag ghcr.io/danbulant/tcp-spawner:latest
|
||||
- name: Tag the docker image (date)
|
||||
run: docker tag ghcr.io/danbulant/tcp-spawner:latest ghcr.io/danbulant/tcp-spawner:$(date --iso-8601)
|
||||
- name: Publish the Docker image
|
||||
run: docker push ghcr.io/danbulant/tcp-spawner:$(date --iso-8601)
|
||||
- name: Publish the Docker image
|
||||
run: docker push ghcr.io/danbulant/tcp-spawner:latest
|
||||
|
|
|
|||
|
|
@ -29,4 +29,7 @@ COPY --from=builder /usr/src/app/target/x86_64-unknown-linux-musl/release/tcp-sp
|
|||
|
||||
EXPOSE 1337
|
||||
|
||||
LABEL org.opencontainers.image.source=https://github.com/danbulant/ctf-tcp-server
|
||||
LABEL org.opencontainers.image.description="A simple TCP process spawner written in Rust."
|
||||
|
||||
CMD ["tcp-spawner", "0.0.0.0:1337", "sh"]
|
||||
Loading…
Reference in a new issue