first #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to DisCloud | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.22.4 | |
- name: Build the Docker image | |
run: docker build -t mugen_scrapper . | |
- name: Login to Docker Hub | |
env: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
run: | | |
echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin | |
- name: Push the Docker image | |
run: docker push mugen_scrapper:latest | |
- name: Deploy to DisCloud | |
env: | |
DISCLOUD_API_KEY: ${{ secrets.DISCLOUD_API_KEY }} | |
run: | | |
curl -X POST "https://discloudbot.com/api/v2/app/deploy" \ | |
-H "api-token: $DISCLOUD_API_KEY" \ | |
-F "file=@./Dockerfile" \ | |
-F "file=@./.dockerignore" \ | |
-F "file=@./main" |