diff --git a/.github/workflows/publish-version.yaml b/.github/workflows/publish-version.yaml new file mode 100644 index 0000000..1e80574 --- /dev/null +++ b/.github/workflows/publish-version.yaml @@ -0,0 +1,43 @@ +name: Release + +on: + release: + types: [created] + +jobs: + build-and-release: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Build Docker image + run: docker build --rm -t phantomized . + + - name: Run Docker image + run: docker run --name phantomized -e PHANTOM_VERSION=2.1.1 phantomized + + - name: Copy file from Docker container + run: docker cp phantomized:/app/dockerized-phantomjs.tar.gz ./dockerized-phantomjs.tar.gz + + - name: Remove Docker container + run: docker rm phantomized + + # - name: Upload artifact + # uses: actions/upload-artifact@v4 + # with: + # name: phantomized.tar.gz + # path: ./dockerized-phantomjs.tar.gz + + - name: Upload artifact to release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./dockerized-phantomjs.tar.gz + asset_name: dockerized-phantomjs.tar.gz + asset_content_type: application/gzip diff --git a/Dockerfile b/Dockerfile index 390eba4..e0fd929 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,11 @@ -FROM ubuntu:14.04 -MAINTAINER Gravebot +FROM ubuntu:18.04 # Setup system deps RUN apt-get update RUN apt-get -y install build-essential curl rsync tar python python-pip git libfontconfig1 # Setup Node -ENV NODE_VERSION 4.4.2 +ENV NODE_VERSION 6.17.1 ENV NPM_VERSION 3.8.5 RUN git clone https://github.com/creationix/nvm.git /.nvm