From 5a854aa45147c47bb3ff33c36ed40b253fafdbca Mon Sep 17 00:00:00 2001 From: jamesread Date: Mon, 9 Sep 2024 17:20:25 +0100 Subject: [PATCH] Add container workflow --- .github/workflows/build-containers.yml | 42 ++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/build-containers.yml diff --git a/.github/workflows/build-containers.yml b/.github/workflows/build-containers.yml new file mode 100644 index 000000000..e8240303a --- /dev/null +++ b/.github/workflows/build-containers.yml @@ -0,0 +1,42 @@ +--- +name: "Build Tag" + +on: + push: + tags: + - '*' + +jobs: + build-tag: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: | + **/package-lock.json + + - name: Login to ghcr + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.CONTAINER_TOKEN }} + + - name: docker build + run: npm run docker-build + + - name: docker tag + run: | + docker tag localhost/postiz ghcr.io/githubhq/postiz-app:${{ GITHUB_REF_NAME }} + docker push ghcr.io/githubhq/postiz-app:${{ GITHUB_REF_NAME }} + + docker tag localhost/postiz-devcontainer ghcr.io/githubhq/postiz-app:${{ GITHUB_REF_NAME }} + docker push ghcr.io/githubhq/postiz-devcontainer:${{ GITHUB_REF_NAME }}