diff --git a/.dockerignore b/.dockerignore index 91efad0..e38526a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,3 @@ *.aes -codeship-services.yml -codeship-steps.yml dockercfg *.env 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/Dockerfile b/Dockerfile index 7de5fb2..df21f50 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,8 @@ FROM alpine:3 # Variables set with ARG can be overridden at image build time with # "--build-arg var=value". They are not available in the running container. ARG restic_ver=0.16.0 -ARG tfc_ops_ver=3.5.1 -ARG tfc_ops_distrib=tfc-ops_${tfc_ops_ver}_Linux_x86_64.tar.gz +ARG tfc_ops_ver=3.5.4 +ARG tfc_ops_distrib=tfc-ops_Linux_x86_64.tar.gz # Install Restic, tfc-ops, perl, and jq RUN cd /tmp \ diff --git a/codeship-services.yml b/codeship-services.yml deleted file mode 100644 index bfb9210..0000000 --- a/codeship-services.yml +++ /dev/null @@ -1,5 +0,0 @@ -app: - build: - image: silintl/tfc-backup-b2 - dockerfile: ./Dockerfile - cached: true diff --git a/codeship-steps.yml b/codeship-steps.yml deleted file mode 100644 index 4ef2f93..0000000 --- a/codeship-steps.yml +++ /dev/null @@ -1,22 +0,0 @@ -- name: push_branch - service: app - type: push - image_name: silintl/tfc-backup-b2 - image_tag: "{{.Branch}}" - exclude: (main) - registry: https://index.docker.io/v1/ - encrypted_dockercfg_path: dockercfg.encrypted - -- name: push_latest - service: app - type: push - image_name: silintl/tfc-backup-b2 - image_tag: "latest" - tag: main - registry: https://index.docker.io/v1/ - encrypted_dockercfg_path: dockercfg.encrypted - -#- name: test -# service: app -# command: echo "Image was tested" - diff --git a/dockercfg.encrypted b/dockercfg.encrypted deleted file mode 100644 index becba3e..0000000 --- a/dockercfg.encrypted +++ /dev/null @@ -1,2 +0,0 @@ -codeship:v2 -7dIJy1+PbnBmTeT07EE1uGyRLKXSVolFSBdCuppOIGWBGFaINyq82M6ggw37zZJewKvnjuMkgGFH2uEoDd7sSDFZnvNqgsAKvU9NGhl2hQqfPOgE2LZe4UbFuH/GGWXL/mQ24pDdxkE90GL6Zma1Is7O3yxybeffNEdMqIeEAwMR4IqB6Zp0I6RwcpMN+PrrpS3IYXUx78VHHMk9vYh2mC4+XI6mIKDZSKw/ozZTqGy4iJtY2HJuRuOGM8UanJAB+5s0f1NV5WAu0YW9Mdj3F4K8zPNdEVaC+lpM0hQpDxCOkurU1VuqKRylXUPWuHG/xoY5jB3yX7vkhJcsdckIoXXIB+S1Eki4U/+hOQ1Sc9Ftx38O4r9l4pu9G3k0dUVaGM7to3NikFWcWpLRAsbR4BOHN8eL34g+VWT715DK0hcDysBqdXBv3w== \ No newline at end of file