From 0329f408071318f6137d0ae0ab0e6181bbf4845e Mon Sep 17 00:00:00 2001 From: evannregnault Date: Sun, 28 May 2023 23:15:31 +0200 Subject: [PATCH] Action #5 --- .github/workflows/main.yml | 55 ++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3bd7877..5b81d8a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,34 +18,31 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - - name: Set up Docker - uses: docker/build-push-action@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: Cargo install + uses: actions-rs/cargo@v1 + with: + command: install + args: cargo-semver + + - name: Semver + run: + echo "VERSION=$(cargo semver get)" >> $GITHUB_ENV + + - name: Build and push + uses: docker/build-push-action@v4 with: context: . - push: false - - - name: Set up Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - - name: Install libavutil development package - run: sudo apt-get update && sudo apt-get install -y libavutil-dev - - - - name: Install Cargo Dependencies - run: cargo install metadata - - - name: Get App Version - id: version - run: cargo metadata --format-version 1 | jq -r '.packages[0].version' - - - name: Login to Docker registry - run: echo "${{ env.DOCKER_PASSWORD }}" | docker login -u "${{ env.DOCKER_USERNAME }}" --password-stdin "${{ env.DOCKER_REGISTRY }}" - - - name: Build and push Docker image - run: | - docker build --pull --cache-from "${{ env.DOCKER_REGISTRY }}/your-image:${{ steps.version.outputs.version }}" --tag "${{ env.DOCKER_REGISTRY }}/your-image:${{ steps.version.outputs.version }}" . - docker push "${{ env.DOCKER_REGISTRY }}/your-image:${{ steps.version.outputs.version }}" \ No newline at end of file + platforms: linux/amd64 + push: true + tags: | + user/app:latest + user/app:1.0.0 + ${{ env.DOCKER_REGISTRY }}/obsessed-yanqing:latest + ${{ env.DOCKER_REGISTRY }}/obsessed-yanqing:${{ env.VERSION }} \ No newline at end of file