diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 0000000..1517dc4 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,18 @@ +name: Push + +on: push, release + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install Go + uses: actions/setup-go@v2 + - name: Build + run: go build . + - name: List dir + run: ls + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..deadb74 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,88 @@ +# name: Release + +# on: +# release: +# types: [released] + +# jobs: +# lint: +# runs-on: ubuntu-latest + +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# - name: Use Node.js 14 +# uses: actions/setup-node@v2-beta +# with: +# node-version: 14.x +# - name: Install dependencies +# run: npm ci +# - name: Lint +# run: npm run lint + +# build: +# needs: lint + +# runs-on: ubuntu-latest + +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# - name: Use Node.js 14 +# uses: actions/setup-node@v2-beta +# with: +# node-version: 14.x +# - name: Install dependencies +# run: npm ci +# - name: Build +# run: npm run build +# - name: Upload build +# uses: actions/upload-artifact@v2 +# with: +# name: dist +# path: dist + +# release: +# needs: build + +# runs-on: ubuntu-latest + +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# - name: Download build +# uses: actions/download-artifact@v2 +# with: +# name: dist +# path: dist +# - name: Build docker image and push to GitHub registry +# uses: docker/build-push-action@v1 +# with: +# username: ${{ github.actor }} +# password: ${{ secrets.GITHUB_TOKEN }} +# registry: docker.pkg.github.com +# repository: yanislav-igonin/face-fucker-bot/face-fucker-bot +# dockerfile: production.Dockerfile +# tags: latest, ${{ github.event.release.tag_name }} +# build_args: CI_COMMIT_TAG=${{ github.event.release.tag_name }} + +# deploy: +# needs: release + +# runs-on: ubuntu-latest + +# steps: +# - name: Deploy +# uses: appleboy/ssh-action@master +# env: +# REGISTRY: docker.pkg.github.com/yanislav-igonin/face-fucker-bot +# SERVICE_NAME: face-fucker-bot_app +# with: +# host: ${{ secrets.VPS_HOST }} +# username: ${{ secrets.VPS_SSH_USERNAME }} +# key: ${{ secrets.VPS_SSH_PRIVATE_KEY }} +# script: | +# docker login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ${{ env.REGISTRY }} +# docker pull ${{ env.REGISTRY }}:${{ github.event.release.tag_name }} +# docker pull ${{ env.REGISTRY }}:latest +# docker service update --image ${{ env.REGISTRY }}:${{ github.event.release.tag_name }} ${{ env.SERVICE_NAME }} \ No newline at end of file