diff --git a/.github/workflows/module-1.yaml b/.github/workflows/module-1.yaml index cf74386..11792bb 100644 --- a/.github/workflows/module-1.yaml +++ b/.github/workflows/module-1.yaml @@ -28,9 +28,11 @@ jobs: app-ml-docker: runs-on: ubuntu-latest + permissions: contents: read packages: write + steps: - name: Checkout repository uses: actions/checkout@v4 @@ -40,11 +42,12 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 with: - images: ghcr.io/app-ml + images: ghcr.io/kyryl-opens-ml/app-ml - name: Build and push Docker image uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 @@ -54,55 +57,35 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - # build-and-push-app-ml: - # runs-on: ubuntu-latest - # steps: - # - name: Checkout - # uses: actions/checkout@v2 - - # - name: Login to Docker Hub - # uses: docker/login-action@v1 - # with: - # username: ${{ secrets.DOCKER_HUB_USERNAME }} - # password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v1 - - # - name: Build and push - # uses: docker/build-push-action@v2 - # with: - # context: week-1/app-ml/ - # file: week-1/app-ml/Dockerfile - # push: true - # tags: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.IMAGE_ML_APP }}:latest - # cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.IMAGE_ML_APP }}:buildcache - # cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.IMAGE_ML_APP }}:buildcache,mode=max - - # build-and-push-app-web: - # runs-on: ubuntu-latest - # steps: - # - name: Checkout - # uses: actions/checkout@v2 - - # - name: Login to Docker Hub - # uses: docker/login-action@v1 - # with: - # username: ${{ secrets.DOCKER_HUB_USERNAME }} - # password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + app-web-docker: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ghcr.io/kyryl-opens-ml/app-web - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v1 + - name: Build and push Docker image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: module-1/app-web/ + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} - # - name: Build and push - # uses: docker/build-push-action@v2 - # with: - # context: week-1/app-web/ - # file: week-1/app-web/Dockerfile - # push: true - # tags: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.IMAGE_ML_WEB }}:latest - # cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.IMAGE_ML_WEB }}:buildcache - # cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.IMAGE_ML_WEB }}:buildcache,mode=max # build-and-push-app-ml-cli-comands: # runs-on: ubuntu-latest