Compare commits
3 Commits
e8559435ac
...
0c7c104e2e
Author | SHA1 | Date | |
---|---|---|---|
|
0c7c104e2e | ||
|
eabec6e234 | ||
|
abb95ae052 |
40
.gitea/workflows/build.yaml
Normal file
40
.gitea/workflows/build.yaml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
name: Build & Publish
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out the repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: https://github.com/docker/metadata-action@v4
|
||||||
|
with:
|
||||||
|
images: git.flokaiser.com/dhbw/pmgame
|
||||||
|
tags: |
|
||||||
|
type=sha,enable=true,priority=100,prefix={{branch}}-,suffix=,format=short
|
||||||
|
type=raw,value=latest,enable={{is_default_branch}}
|
||||||
|
|
||||||
|
- name: Get get-docker.sh
|
||||||
|
run: curl -fsSL https://get.docker.com -o get-docker.sh
|
||||||
|
|
||||||
|
- name: Install docker
|
||||||
|
run: sh get-docker.sh
|
||||||
|
|
||||||
|
- name: Login to Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: git.flokaiser.com
|
||||||
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
platforms: linux/amd64
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
@ -1,43 +0,0 @@
|
|||||||
pipeline:
|
|
||||||
generate_docker_tag:
|
|
||||||
image: golang
|
|
||||||
commands:
|
|
||||||
- echo -n "${CI_COMMIT_BRANCH//\//-}-${CI_COMMIT_SHA:0:8}, latest" > .tags
|
|
||||||
when:
|
|
||||||
event: push
|
|
||||||
|
|
||||||
build:
|
|
||||||
image: woodpeckerci/plugin-docker-buildx
|
|
||||||
settings:
|
|
||||||
repo:
|
|
||||||
from_secret: repo
|
|
||||||
username:
|
|
||||||
from_secret: username
|
|
||||||
password:
|
|
||||||
from_secret: password
|
|
||||||
registry:
|
|
||||||
from_secret: registry
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
platforms: linux/amd64
|
|
||||||
when:
|
|
||||||
event: push
|
|
||||||
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
image: appleboy/drone-ssh
|
|
||||||
network_mode: host
|
|
||||||
settings:
|
|
||||||
host:
|
|
||||||
from_secret: ssh_host
|
|
||||||
username:
|
|
||||||
from_secret: ssh_user
|
|
||||||
password:
|
|
||||||
from_secret: ssh_password
|
|
||||||
script:
|
|
||||||
- cd ~/docker-compose-files/pm_game
|
|
||||||
- docker-compose pull
|
|
||||||
- docker-compose up -d
|
|
||||||
when:
|
|
||||||
event: push
|
|
||||||
|
|
||||||
branches: main
|
|
@ -16,8 +16,8 @@ COPY minimize.sh minimize.sh
|
|||||||
RUN chmod +x minimize.sh
|
RUN chmod +x minimize.sh
|
||||||
RUN ./minimize.sh
|
RUN ./minimize.sh
|
||||||
RUN sed -i "s/DATE_TO_BE_REPLACED/$(date +%s)/" public/index.html
|
RUN sed -i "s/DATE_TO_BE_REPLACED/$(date +%s)/" public/index.html
|
||||||
RUN sed -i "s/COMMIT_TO_BE_REPLACED/GitHub: $(git ls-remote https://github.com/H4CK3R-01/Projektmanagement-Game refs/heads/main | awk '{print $1;}' | cut -c1-7)/" public/index.html
|
RUN sed -i "s/COMMIT_TO_BE_REPLACED/GitHub: $(git ls-remote https://git.flokaiser.com/DHBW/Projektmanagement-Game refs/heads/main | awk '{print $1;}' | cut -c1-7)/" public/index.html
|
||||||
RUN sed -i "s/COMMIT_LINK_TO_BE_REPLACED/https\:\/\/github.com\/H4CK3R-01\/Projektmanagement-Game\/commit\/$(git ls-remote https://github.com/H4CK3R-01/Projektmanagement-Game refs/heads/main | awk '{print $1;}')/" public/index.html
|
RUN sed -i "s/COMMIT_LINK_TO_BE_REPLACED/https\:\/\/git.flokaiser.com\/DHBW\/Projektmanagement-Game\/commit\/$(git ls-remote https://git.flokaiser.com/DHBW/Projektmanagement-Game refs/heads/main | awk '{print $1;}')/" public/index.html
|
||||||
|
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user