19 lines
589 B
YAML
19 lines
589 B
YAML
name: Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: ['master']
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: self-hosted
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Build image
|
|
run: docker build -t ${{ github.repository }} .
|
|
- name: Deploy image
|
|
run: |
|
|
docker stop ${{ github.event.repository.name }} || true
|
|
docker rm ${{ github.event.repository.name }} || true
|
|
docker run -d -e "TOKEN=${{ secrets.TOKEN }}" -e "ENVIRONMENT=${{ secrets.ENVIRONMENT }}" --restart always -p 2020:2020 --name ${{ github.event.repository.name }} ${{ github.repository }}
|