diff --git a/.dockerignore b/.dockerignore index f1d320d..b6cf10a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,2 @@ *.aes -codeship-services.yml -codeship-steps.yml dockercfg diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml new file mode 100644 index 0000000..4237f6f --- /dev/null +++ b/.github/workflows/build-and-publish.yml @@ -0,0 +1,37 @@ +name: Build and Publish + +on: + push: + +jobs: + build-and-publish: + name: Build and Publish + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ vars.DOCKER_ORG }}/${{ github.event.repository.name }} + tags: | + type=ref,event=branch + type=ref,event=tag + # set latest tag for master branch + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/codeship-services.yml b/codeship-services.yml deleted file mode 100644 index 6695003..0000000 --- a/codeship-services.yml +++ /dev/null @@ -1,5 +0,0 @@ -app: - build: - image: silintl/mysql-backup-restore - dockerfile: ./Dockerfile - cached: true diff --git a/codeship-steps.yml b/codeship-steps.yml deleted file mode 100644 index 5e96e4e..0000000 --- a/codeship-steps.yml +++ /dev/null @@ -1,17 +0,0 @@ -- name: push_branch - service: app - type: push - image_name: silintl/mysql-backup-restore - image_tag: "{{.Branch}}" - exclude: ^(main|snyk*) - registry: https://index.docker.io/v1/ - encrypted_dockercfg_path: dockercfg.encrypted - -- name: push_latest - service: app - type: push - image_name: silintl/mysql-backup-restore - image_tag: "latest" - tag: main - registry: https://index.docker.io/v1/ - encrypted_dockercfg_path: dockercfg.encrypted diff --git a/dockercfg.encrypted b/dockercfg.encrypted deleted file mode 100644 index 00c5a6f..0000000 --- a/dockercfg.encrypted +++ /dev/null @@ -1,2 +0,0 @@ -codeship:v2 -BScPjmqUw7hFx9ZW8TpjL9cIXw+1Faw6Xo/kOFPyh8Lr6qoSnpqL9wU/OW2yObPm9igjCqTxCIDWfCE/5sr3qVo2RCI2cI73zrRIyUReJrORwIVc0wxGauwi3ctj5zSCSlNOcTI5SoY736UhZ1XIPLeHnwI1Y/eA3MRG9D2inlf2VsZNgw0D2pddTMRfQVzSmz4dPGg2MceRSqUjf+cGomfBiW/ZXNih7jNl+2DlwD5s/fJBYk+OKfPnwoq6/no489YZBksMttfZtkt/2KG+teiXCB/gJ43OUYhj6jucZP36RHpkcjTbD+uJ88VJ \ No newline at end of file