Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch CI to GitHub Actions #3

Closed
simonw opened this issue Nov 6, 2020 · 9 comments
Closed

Switch CI to GitHub Actions #3

simonw opened this issue Nov 6, 2020 · 9 comments

Comments

@simonw
Copy link
Owner

simonw commented Nov 6, 2020

No description provided.

@simonw
Copy link
Owner Author

simonw commented Nov 6, 2020

This bit is tricky:

sqlite-fts4/.travis.yml

Lines 24 to 27 in 9f4912f

- npm install -g now
- pip install https://github.com/simonw/datasette/archive/master.zip
- curl --silent -o 24ways-fts4.db https://24ways-fts4-db.now.sh/
- datasette publish now 24ways-fts4.db --token=$NOW_TOKEN --alias=datasette-sqlite-fts4.datasette.io --name=datasette-sqlite-fts4 --install https://github.com/simonw/sqlite-fts4/archive/$TRAVIS_TAG.zip --install=datasette-sqlite-fts4 --install=datasette-json-html --source_url=https://github.com/simonw/sqlite-fts4

Publishes https://datasette-sqlite-fts4.datasette.io/

@simonw
Copy link
Owner Author

simonw commented Nov 6, 2020

Something like this - I'll do this as a separate deploy-demo.yml action:

    - name: Publish demo
      run: |-
        curl --silent -o 24ways-fts4.db https://24ways-fts4-db.now.sh/
        pip install datasette datasette-publish-vercel
        datasette publish vercel 24ways-fts4.db \
          --token $NOW_TOKEN \
          --project datasette-sqlite-fts4 \
          --install https://github.com/simonw/sqlite-fts4/archive/$TRAVIS_TAG.zip \
          --install datasette-sqlite-fts4 \
          --install datasette-json-html \
          --source_url=https://github.com/simonw/sqlite-fts4

@simonw
Copy link
Owner Author

simonw commented Nov 6, 2020

I need the GitHub Actions equivalent of $TRAVIS_TAG.

@simonw
Copy link
Owner Author

simonw commented Nov 6, 2020

I think that's:

      with:
          tag: ${{ env.GITHUB_TAG }}

@simonw
Copy link
Owner Author

simonw commented Nov 6, 2020

Actually I will do it in the publish.yml - I think this will work:

    - name: Publish demo
      env:
        GITHUB_TAG: ${{ env.GITHUB_TAG }}
        NOW_TOKEN: ${{ secrets.NOW_TOKEN }}
      run: |-
        curl --silent -o 24ways-fts4.db https://24ways-fts4-db.now.sh/
        pip install datasette datasette-publish-vercel
        datasette publish vercel 24ways-fts4.db \
          --token $NOW_TOKEN \
          --project datasette-sqlite-fts4 \
          --install https://github.com/simonw/sqlite-fts4/archive/$GITHUB_TAG.zip \
          --install datasette-sqlite-fts4 \
          --install datasette-json-html \
          --source_url=https://github.com/simonw/sqlite-fts4

@simonw
Copy link
Owner Author

simonw commented Nov 6, 2020

I created a NOW_TOKEN secret for this repo using a token for my vercel simonw account.

simonw added a commit that referenced this issue Nov 6, 2020
simonw added a commit that referenced this issue Nov 6, 2020
@simonw
Copy link
Owner Author

simonw commented Nov 6, 2020

I'm going to release a 1.0 to exercise this.

simonw added a commit that referenced this issue Nov 6, 2020
@simonw
Copy link
Owner Author

simonw commented Nov 6, 2020

Rats, the Vercel deploy failed:


Error: Command failed: pip3 install --disable-pip-version-check --target . --upgrade -r /vercel/workpath0/requirements.txt
--
22:10:07.767 | ERROR: HTTP error 404 while getting https://github.com/simonw/sqlite-fts4/archive/.zip
22:10:07.767 | ERROR: Could not install requirement https://github.com/simonw/sqlite-fts4/archive/.zip (from -r /vercel/workpath0/requirements.txt (line 3)) because of error 404 Client Error: Not Found for url: https://github.com/simonw/sqlite-fts4/archive/.zip

So it looks like the GITHUB_TAG bit didn't work.

simonw added a commit that referenced this issue Nov 6, 2020
simonw added a commit that referenced this issue Nov 6, 2020
@simonw
Copy link
Owner Author

simonw commented Nov 6, 2020

That worked and published https://datasette-sqlite-fts4.simonw.vercel.app/

@simonw simonw closed this as completed Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant