From baa23e592508611d2417c000dad6a68e561b2c65 Mon Sep 17 00:00:00 2001 From: Jun Kurihara Date: Tue, 5 Jul 2022 21:44:55 +0900 Subject: [PATCH] add github actions --- .github/FUNDING.yml | 1 + .github/dependabot.yml | 27 ++++++++++++++++++++ .github/workflows/docker_build_push.yml | 34 +++++++++++++++++++++++++ docker-compose.yml | 12 +++++++++ 4 files changed, 74 insertions(+) create mode 100644 .github/FUNDING.yml create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/docker_build_push.yml create mode 100644 docker-compose.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..9768784 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: junkurihara diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..4293fb7 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,27 @@ +# Basic dependabot.yml file with +# minimum configuration for two package managers + +version: 2 +updates: + # Enable version updates for cargo + - package-ecosystem: "cargo" + # Look for `Cargo.toml` and `lock` files in the `root` directory + directory: "/" + # Check the crates.io for updates every day (weekdays) + schedule: + interval: "daily" + + # Enable version updates for Docker + - package-ecosystem: "docker" + # Look for a `Dockerfile` in the `root` directory + directory: "/" + # Check for updates everyday + schedule: + interval: "daily" + + # Enable version updates for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates everyday + interval: "daily" diff --git a/.github/workflows/docker_build_push.yml b/.github/workflows/docker_build_push.yml new file mode 100644 index 0000000..a9a717c --- /dev/null +++ b/.github/workflows/docker_build_push.yml @@ -0,0 +1,34 @@ +name: Build and Publish Docker + +on: + push: + branches: + - main + +jobs: + build_and_push: + runs-on: ubuntu-latest + env: + IMAGE_NAME: rpxy + + steps: + - name: checkout + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + push: true + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest + file: ./Dockerfile diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..2a3ae2c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +version: "3" +services: + rpxy-rp: + image: jqtype/rpxy + container_name: rpxy + restart: unless-stopped + ports: + - 127.0.0.1:8080:8080 + tty: false + privileged: true + volumes: + - ./config-example.toml:/etc/rpxy.toml:ro