diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..b86a437 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,20 @@ +kind: pipeline +name: build +type: docker + +steps: + - name: get cargo tag + image: rust:alpine + commands: + - cargo install cargo-get + - echo "$(cargo get package.version --pretty),latest" > .tags + + - name: build + image: plugins/docker + settings: + registry: r.regnault.dev + username: + from_secret: DOCKER_USERNAME + password: + from_secret: DOCKER_PASSWORD + repo: r.regnault.dev/obsessed-yanqing diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index ff04bfd..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Docker Build and Push with Version - -on: - push: - branches: - - master - - action-test - -env: - DOCKER_REGISTRY: r.regnault.dev - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - PORTAINER_API_WEBHOOK: ${{ secrets.PORTAINER_API_WEBHOOK }} - -jobs: - build_and_push: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ env.DOCKER_REGISTRY }} - username: ${{ env.DOCKER_USERNAME }} - password: ${{ env.DOCKER_PASSWORD }} - - - name: Install cargo-semver - uses: actions-rs/install@v0.1.2 - with: - crate: cargo-get - version: latest - - - name: Semver - run: - echo "VERSION=$(cargo get package.version --pretty)" >> $GITHUB_ENV - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: . - push: true - tags: | - ${{ env.DOCKER_REGISTRY }}/obsessed-yanqing:latest - ${{ env.DOCKER_REGISTRY }}/obsessed-yanqing:${{ env.VERSION }} - cache-from: type=gha - cache-to: type=gha,mode=max - - - name: Deploy to production - uses: fjogeleit/http-request-action@v1.14.1 - with: - url: ${{ format('{0}?tag={1}',env.PORTAINER_API_WEBHOOK, env.VERSION) }} - method: 'POST' - preventFailureOnNoResponse: true